Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

I keep getting error Array indices must be positive integers or logical values.

1 visualizzazione (ultimi 30 giorni)
y=linspace(0,50,100);
d=50
mu=.3
ybyd=y/d%y/d%
uinfi=10;%u infinity value%
for alpha=-3:3
u=(uinfi.*(ybyd+((alpha.*ybyd).*(1-ybyd))))
plot(u,ybyd)
ta=@(y) mu*uinfi((1/d)+alpha*((1/d)-((2*y)/(d^2))))
tau=ta(y)
subplot(tau,ybyd)
xlabel('Velocity')
ylabel('Y/D')
title('Velocity profile')
hold on
end

Risposte (1)

David Hill
David Hill il 4 Mag 2020
y=linspace(0,50,100);
d=50
mu=.3
ybyd=y/d%y/d%
uinfi=10;%u infinity value%
for alpha=-3:3
u=(uinfi.*(ybyd+((alpha.*ybyd).*(1-ybyd))));
plot(u,ybyd);
ta=@(y) mu*uinfi*((1/d)+alpha*((1/d)-((2*y)/(d^2))));%need uinfi*
tau=ta(y);
plot(tau,ybyd);
xlabel('Velocity')
ylabel('Y/D')
title('Velocity profile')
hold on
end

Community Treasure Hunt

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

Start Hunting!

Translated by