How to create vector of Objects
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Abebe Haftu Fitur
am 7 Mai 2018
Kommentiert: Tomas Hindrich
am 14 Apr. 2020
I want to put all objects in form of a vector, none of the things I look on the internet doesn't help me to solve my problem, is there anyone can help on how to save them on a single variable, with possible to access back the by referencing them. Just like this vairbale= [radarmotion1 radarmotion2 radarmotion3 radarmotion4 ], you can look from the script below how my objects are created.
radarmotion1 = phased.Platform('InitialPosition',[0;0;0.5],'Velocity',[radar_speed1;0;0]); radarmotion2 = phased.Platform('InitialPosition',[0;0.5;0.5],'Velocity',[radar_speed2;0;0]); radarmotion3 = phased.Platform('InitialPosition',[0.5;0;0.5],'Velocity',[radar_speed3;0;0]); radarmotion4 = phased.Platform('InitialPosition',[0;0.5;1.5],'Velocity',[radar_speed4;0;0]);
Thanks!
1 Kommentar
Jan
am 7 Mai 2018
What happens for
A = [radarmotion1 radarmotion2 radarmotion3 radarmotion4]
? Do you get an error message?
Akzeptierte Antwort
Ameer Hamza
am 7 Mai 2018
Bearbeitet: Ameer Hamza
am 7 Mai 2018
You can use a cell array,
variable = {radarmotion1, radarmotion2, radarmotion3, radarmotion4}
Use curly brackets. Access each element also using curly brackets notataion, variable{1}, variable{2}, ...
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Array Geometries and Analysis finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!