How to change color of the plot when it is called in evalin function?
Afficher commentaires plus anciens
Hello everyone, I am trying to plot the variables from the workspace. I have to plot three different variables together on the same plot with different colors. My code looks likes this : try
evalin('base',['plot(',a,',',x,')'])
grid on
hold on
evalin('base',['plot(',a,',',y,')'])
hold on
evalin('base',['plot(',a,',',z,')'])
catch ex
errordlg(...
ex.getReport('basic'),'Error generating linear plot','modal')
end
How can i make changes in evalin command so as to make plots of different color for each variable set. Please help
Réponses (1)
Can't you just add:
'color',someColour
to your evalin line in whatever is the correct syntax if you really have to use evalin? I've never used it myself, but judging from what you have done so far I don't see why just adding another couple of arguments to the plot function wouldn't work.
I get a syntax error when I try to run the first line of your code so I gave up on my attempt to get the right syntax for adding in the 'color' argument myself.
Catégories
En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!