Why do I get the error «unrecognized function or variable»

18 views (last 30 days)
Simulink: ramp->trs fnc->scope. Scope: Data history -> ✅Save data to workspace -> Variable name: phi -> Format: Array. Command window: figure(1); subplot(2, 1, 1); plot(phi(:,1),phi(:,2)); unrecognized function or variable 'phi'

Answers (1)

madhan ravi
madhan ravi on 17 Dec 2023
Edited: madhan ravi on 17 Dec 2023
Usually you need to use dot indexing to get the variable data.
plot(out.phi(:, 1), out.phi(:, 2))
Use To Workspace block Save format to Array
  3 Comments
Kaisar
Kaisar on 17 Dec 2023
plot(out.phi(:, 1), out.phi(:, 2))
I wrote it, but it gives error «unrecognized field name "phi"

Sign in to comment.

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products


Release

R2023b

Community Treasure Hunt

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

Start Hunting!