Error while converting polyshape into double
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
i have building my polyshape of a ship and i'm trying to rotate it depends on "head" value, which is the angle of the ship in radian.
in simple script it rotate absolutely fine, but in main script it find some error because the polyshape cannot convert into double data.
here i attached all my relevant script, the main script is "Kedua_LoopScript.m"
wonder why it cannot works and how to solve it
0 Kommentare
Akzeptierte Antwort
Matt J
am 20 Jun. 2023
Bearbeitet: Matt J
am 21 Jun. 2023
You have pre-allocated ShipImg as a numeric double float vector,
ShipImg = ones(1,length(t)); %a double vector of ones
Then instead of trying to insert a number into ShipImg(n) in line 208, you try to assign a polyshape,
ShipImg(n) = ShipImgRotation(rad2deg(head(n)),LPP,B,xG); %right hand side is a polyshape, left side is not
You cannot stick a polyshape object into a memory location reserved for a double float.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Elementary Polygons 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!