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 Kommentar

Rik
Rik am 17 Mär. 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})

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Rene Riha
Rene Riha am 17 Mär. 2018

0 Stimmen

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

1 Kommentar

Rik
Rik am 17 Mär. 2018
You are aware that both syntaxes result in the same shape of the same data type?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 17 Mär. 2018

Kommentiert:

Rik
am 17 Mär. 2018

Community Treasure Hunt

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

Start Hunting!

Translated by