Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Showing error Matrix dimensions must agree
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
r=[0 : 100 :100];
theta =[0 : 2*pi :100];
z=2*(r-4*sin(theta)./r);
Matrix dimensions must agree.
0 Kommentare
Antworten (2)
madhan ravi
am 21 Sep. 2019
theta =0:2*pi:100;
r=linspace(0,100,numel(theta)); % theta and r should have same length/ or either one be a scalar
z=2*(r-4*sin(theta)./r);
doc linspace
doc numel
0 Kommentare
the cyclist
am 21 Sep. 2019
The variable r has just two elements: [0 100].
theta has 16 elements: [0 6.2832 12.5664 18.8496 ...]
What do you expect to happen when you try to divide a vector with 16 elements by one with 2 elements?
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!