Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Getting error while plotting a 2d countour

1 visualizzazione (ultimi 30 giorni)
Rajanikanta Swain
Rajanikanta Swain il 24 Ott 2016
Chiuso: MATLAB Answer Bot il 20 Ago 2021
Getting error while plotting a 2d countour plot in my GUI pushbutton functin. Is there any differnce in gui contour and ordinary countur plot? Also how to enter a matrix as input in my gui front pannel... Please helpme...
  1 Commento
Alexandra Harkai
Alexandra Harkai il 25 Ott 2016
What is the error you're getting? What is it you're trying to plot? Without these it's quite hard to see where your issue is.

Risposte (1)

Marc Jakobi
Marc Jakobi il 25 Ott 2016
In a GUI created in GUIDE, you may have to specify the axes in which to create the contour.
contour(handles.axesName, x, y, z, ...)
You can find/set the "axesName" in the Tag property of the axes.
  2 Commenti
Marc Jakobi
Marc Jakobi il 25 Ott 2016
Glad I could help. Please accept my answer if it helped you.
will return an empty value and
will return NaN (Not a Number). This is because the string 'X=[5,-5]' is not a number. You will have to find a way to extract the numbers from the string 'X=[5,-5]', e. g.
Str = get(handles.edit8, 'String'); % returns the string 'X=[5,-5]'
i1 = strfind(Str, '[');
a = sscanf(Str(i1 + 1:end), '%g', 1);
i2 = strfind(Str, ',');
b = sscanf(Str(i2 + 1:end), '%g', 1);
X = [a, b];


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by