how plot only show the value which I selected

1 visualizzazione (ultimi 30 giorni)
Yixuan Zhang
Yixuan Zhang il 16 Set 2019
Risposto: Walter Roberson il 16 Set 2019
I set up a menu for selection, but even I just select one of them the plot still showing all of them, how can I change it?
Location = menu('Please select a loaction',LocationID);
fprintf('On Day %d, at location %s, the ice thickness was %0.4f [m]\n',Days(day),LocationID(location),Ice(day,location));
plot(Days,Ice,'ro');
xlabel('Time(day)')
ylabel('Ice Thickness(m)')
grid on

Risposte (1)

Walter Roberson
Walter Roberson il 16 Set 2019
Location = menu('Please select a loaction',LocationID);
assigns to a variable named Location with an upper-case L
fprintf('On Day %d, at location %s, the ice thickness was %0.4f [m]\n',Days(day),LocationID(location),Ice(day,location));
reads from a variable named location with a lower-case L.
MATLAB is case sensitive. You are not using the variable you think you are.

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by