error in using the sum function
Afficher commentaires plus anciens
I am getting an error I can't understand.
I attached the code and a photo.
thanks!
clear all
close all
clc
m=5; %number of groups
n=10 %size of each group
sz=[m n];
sum=0;
G=0+(100-0)*rand([sz]);
G1=G(1,:);
sum(G1);
1 commentaire
Réponse acceptée
Plus de réponses (1)
ANKUR KUMAR
le 27 Sep 2018
You have already defined sum as a variable
clc
clear
m=5; %number of groups
n=10 %size of each group
sz=[m n];
G=0+(100-0)*rand([sz]);
G1=G(1,:);
sum(G1)
sum(G,1)%along first dimension
sum(G,2) %along second dimension
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!