Why am i getting complex number?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
pos =zeros(num,2);
for j=1:num
pos(j,1)= 200*rand(1);
pos(j,2) = 200*rand(1);
end
I was trying to get positions and i am getting complex number in workspace. When i tried to display, it was real number. Why is workspace storing complex number?
1 Kommentar
Fangjun Jiang
am 29 Mär. 2023
What do you mean? You can run it here and see results.
num=3;
pos =zeros(num,2);
for j=1:num
pos(j,1)= 200*rand(1);
pos(j,2) = 200*rand(1);
end
pos
Antworten (1)
Fangjun Jiang
am 29 Mär. 2023
Are you sure you got complex numbers? Complex numbers are like below.
clear i j;
i
j
a=2+3i
b=4-5j
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!