Unable to perform assignment because the size of the left side is 42-by-1 and the size of the right side is 42-by-95
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Maskus Kit
il 31 Gen 2021
Commentato: Maskus Kit
il 31 Gen 2021
Could anybidy be so kind as to help a newbie with this error in my code below? Thanks.
totalu = zeros(size(Xpiv));
for a = 1:length(velocity_magnitude)
totalu(:,a) = totalu + velocity_magnitude(:,1);
end
0 Commenti
Risposta accettata
Walter Roberson
il 31 Gen 2021
totalu = zeros(size(Xpiv));
for a = 1:length(velocity_magnitude)
totalu(:,a) = totalu(:,a) + velocity_magnitude(:,1);
end
However, notice that you are adding the same column out of velocity_magnitude. You should probably be doing
totalu = zeros(size(Xpiv));
for a = 1:length(velocity_magnitude)
totalu(:,a) = totalu(:,a) + velocity_magnitude(:,a);
end
and in turn that could be
totalu = zeros(size(Xpiv));
totalu(:,1:size(velocity_magnitude,2)) = velocity_magnitude;
Più risposte (0)
Vedere anche
Categorie
Scopri di più su String in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!