Clear Filters
Clear Filters

String into plot properties

4 views (last 30 days)
Rene Riha
Rene Riha on 17 Mar 2018
Commented: Rik on 17 Mar 2018
Hello, how can I insert string into plot properties? For example I have cell u=[{'k*'}, {'k-'}] and I want plot(x, y, u(1)) but this shows 'Invalid first data argument'. Any solutions? Thank you very much.
  1 Comment
Rik
Rik on 17 Mar 2018
Actually, it looks like the x is the first problem you're having. The second problem is that you're using matrix indexing to get a cell in your plot. You should use plot(x, y, u{1})

Sign in to comment.

Accepted Answer

Rene Riha
Rene Riha on 17 Mar 2018
Thank you, solution was type u={'ko', 'k-'}. Then it works.
  1 Comment
Rik
Rik on 17 Mar 2018
You are aware that both syntaxes result in the same shape of the same data type?

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!