"Invalid handle." Error while using "Plot3".
Afficher commentaires plus anciens
ax = axes('Parent',customUserInterface,'Position',[.1 .5 .375 .4]);
hold on
for m=1:numOfAP
plot3(ax,Data(m).traj(:,1),Data(m).traj(:,2),Data(m).traj(:,3),'g','LineWidth',2)
hold on
grid on
end
hold on
The Error points to the line with "Plot3". What am I going wrong with? Thanks in advance.
5 commentaires
Image Analyst
le 9 Juin 2017
Modifié(e) : Image Analyst
le 9 Juin 2017
Type customUserInterface and ax in the command window and tell us what it shows.
>> ax
>> customUserInterface
Abhay Aradhya
le 9 Juin 2017
Walter Roberson
le 9 Juin 2017
You probably have a "clear all" or "close all" somewhere in your code.
Note: if customUserInterface says it is a deleted Axes then customUserInterface must have been an Axes at one point. But it is not permitted to make an Axes a child of another Axes. Your customUserInterface would need to be a container object such as a figure or uipanel.
Abhay Aradhya
le 9 Juin 2017
Abhay Aradhya
le 9 Juin 2017
Modifié(e) : Abhay Aradhya
le 9 Juin 2017
Réponse acceptée
Plus de réponses (1)
KSSV
le 9 Juin 2017
You should proceed like this.
h = plot3(rand(1,2),rand(1,2),rand(1,2),'g','LineWidth',2) ;
grid on
for m=1:100
set(h,'XData',rand(1,2),'YData',rand(1,2),'ZData',rand(1,2)) ;
end
2 commentaires
Abhay Aradhya
le 9 Juin 2017
Modifié(e) : Abhay Aradhya
le 9 Juin 2017
Abhay Aradhya
le 9 Juin 2017
Modifié(e) : Abhay Aradhya
le 9 Juin 2017
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!