Borrar filtros
Borrar filtros

where do those imaginary values come from?

2 visualizaciones (últimos 30 días)
Evelyn
Evelyn el 18 de Mzo. de 2014
Respondida: Image Analyst el 18 de Mzo. de 2014
If I use this piece of code
b=24;
k=2000*3600;
t=0:1:720;
Q_y = zeros(size(t));
for i = 1:length(t)
if t(i) < 360-b/2
Q_y(i) = (k/(360-b/2))*t(i);
elseif t(i) >= 360-b/2 && t(i) < 360+b/2
Q_y(i) = k;
else
Q_y(i) = (-k/(360-b/2))*t(i)+720*(k/(360-b/2));
end
end
on itself everything is fine, but when I try to use it in a bigger piece of code Q_y suddenly gets imaginary values. Where do they come from and what can I do about them?

Respuesta aceptada

Image Analyst
Image Analyst el 18 de Mzo. de 2014
All will be revealed if you follow these instructions http://blogs.mathworks.com/videos/2012/07/03/debugging-in-matlab/ on your bigger, unshown piece of code.

Más respuestas (0)

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by