I am getting the error as "Error using * Inner matrix dimensions must agree. Error in O1 (line 8) stress=((3​*W*v)/(4*p​i*h*h));" for the following code.Please help me out

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)

Risposte (2)

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)

Questa domanda è chiusa.

Richiesto:

il 1 Mar 2016

Chiuso:

il 1 Mar 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by