I am getting the error as "Error using * Inner matrix dimensions must agree. Error in O1 (line 8) stress=((3*W*v)/(4*pi*h*h));" for the following code.Please help me out
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
r=0.6; P=82.7*1E-6; a=150*1E-6; W=pi*a*2*P; v=0.3; h = linspace(1*1E-6,4*1E-6); stress=((3*W*v)/(4*pi*h*h)); plot(h,stress)
Antworten (2)
JAYESH RAVAL
am 1 Mär. 2016
Please try for loop to do calculation
r=0.6;
P=82.7*1E-6;
a=150*1E-6;
W=pi*a*2*P;
v=0.3;
h = linspace(1*1E-6,4*1E-6);
for i=1:length(h)
stress(i)=((3*W*v)/(4*pi*h(i)*h(i)));
end
plot(h,stress)
Star Strider
am 1 Mär. 2016
0 Stimmen
You need to use the dot operator with the right division (./) as I showed you in your previous Question http://www.mathworks.com/matlabcentral/answers/270715-i-am-not-getting-the-plot-for-thr-following-code-can-anyone-please-identify-the-mistake.
That code works and produces the correct plot.
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!