How to change Axes values to 'String' instead of 'numbers' on Simulink Scope?

3 ビュー (過去 30 日間)
I am currently learning MATLAB/Simulink Software. I usually have seen scope outputs with numbers on the Y-axis. This scope image shows names instead of numbers. Actually, the output is from a Stateflow chart. This is a Sample model program in Simulink (openExample('stateflow/AutomaticTransmissionUsingDurationOperatorExample')). I tried checking the callback functions as well the properties of the blocks and the entire model. I could not understand how the axis properties are changed to a string instead of a number. I have attached the scope output image. Can anyone please help me understand it?

採用された回答

Paul
Paul 2021 年 9 月 12 日
Make the signal input to the scope a Simulink Enumeration type.
  1 件のコメント
Ramkumar Ganesan Rajalekshmi
Ramkumar Ganesan Rajalekshmi 2021 年 9 月 12 日
Thanks a lot Paul. I changed the data type to enum in my model which i was trying and it worked!!
Regards,
Ram

サインインしてコメントする。

その他の回答 (1 件)

Sreedhar Arumugam
Sreedhar Arumugam 2021 年 9 月 12 日
編集済み: Sreedhar Arumugam 2021 年 9 月 12 日
It is my understanding that you are asking why the y-axis is displaying the values as strings such as 'first', 'second' and so on, instead of numerical values.
The first step is to understand the data that the scope is actually displaying. The scope is meant to display how the gear value changes with time. By observing the model, it can be seen that the scope is connected to the output signal from the Gear_logic Stateflow chart.
This chart models the shifting of gears based on throttle and speed of the vehicle. It calculates next gear value based on current gear, throttle, and current vehicle speed.
According to the chart, there are four states that can be reached - 'first', 'second', 'third', 'fourth'
These are the same values that are displayed on the y-axis of the scope output that you have attached.
  1 件のコメント
Ramkumar Ganesan Rajalekshmi
Ramkumar Ganesan Rajalekshmi 2021 年 9 月 12 日
Hello Sreedhar,
Sorry i could not explain properly. I understood the working of the model. But i could not make the scope display the state names in my y-axis. Then i changed the data type to enum and it worked!! Now i am able to visualize the state names on my Y-axis.
Regards,
Ram

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeView and Analyze Simulation Results についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by