How do I define a variable I just made with an IF statement?
Mostrar comentarios más antiguos
>> if x1 <= 0
x2 = x1./2
elseif x1 >= 0
x2 >= x1.*2
end
x3 = sqrt(y.^2 + x2.^2);
figure(1)
plot(t,x3)
Undefined function or variable 'x2'
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Data Exploration en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!