String into plot properties

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 个评论

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})

请先登录,再进行评论。

 采纳的回答

Rene Riha
Rene Riha 2018-3-17

0 个投票

Thank you, solution was type u={'ko', 'k-'}. Then it works.

1 个评论

You are aware that both syntaxes result in the same shape of the same data type?

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Characters and Strings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by