set function with multiple arguments

2 Ansichten (letzte 30 Tage)
kheirou
kheirou am 7 Okt. 2013
Beantwortet: Walter Roberson am 7 Okt. 2013
Hi , i'm tring to plot two functions x & y in the same graph in function of time , and i'm obliged to update values using ' set function ' . I tried this code but it doesn't work ?
if true
set(plotGraph,'XData',time,'YData',[x y]); end
  2 Kommentare
Jan
Jan am 7 Okt. 2013
"It doesn't work" is not a useful description of the occurring problems. Please show us the complete error message of explain the difference between your expectations and the results.
Because we do not now the values of plotGraph, time, x and y we cannot know, what this line exactly means. Please provide more details by editing the original question (hiding important information in comments or pseudo-answers is less useful).
Sean de Wolski
Sean de Wolski am 7 Okt. 2013
What is the output of the following:
size(time)
size([x y])
get(plotGraph)

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 7 Okt. 2013
When you plot() with multiple columns, different lineseries() objects are produced for every column. You need to update both of the lineseries() objects with the appropriate individual column of data. You cannot set() a YData to a matrix of data, only a vector.

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by