Clear Filters
Clear Filters

Getting error in MATLAB State flow

12 views (last 30 days)
THIRUPURASUNDARI
THIRUPURASUNDARI ongeveer 11 uur ago
Answered: Shivam Gothi ongeveer 9 uur ago
I am getting error in MATLAB state flow regarding unresolved symbol and one dimensional vector .but when resolve the symbol i am getting extra input ports from the state flow ,and i am not having any about the one dimensional vector error in output port .I am requesting ,can anyone give solution to my problem.=== Simulation (Elapsed: 1 sec) ===
Error:Chart 'main_project__revised/P_T_Scr_Drc_Ats_State' has unresolved symbols.
Error:Compilation of model 'main_project__revised' failed while trying to resolve underspecified signal dimensions.
Caused by:
Chart 'main_project__revised/P_T_Scr_Drc_Ats_State' has unresolved symbols.
Error in port widths or dimensions. 'Output Port 1' of 'main_project__revised/P_T_Scr_Drc_Ats_State/P_T_scr_drc_sus_err_pend' is a one dimensional vector with 1 elements.
Suggested Actions:
Enable 'warning' or 'error' diagnostics for the list of underspecified signal dimensions.

Answers (1)

Shivam Gothi
Shivam Gothi ongeveer 9 uur ago
As per my understanding, you are trying to resolve the error "Unresolved symbols" in simulink "state flow" block, but trying to do so, introduces an extra input port to the "state-flow block" which is not desirable.
Cause of error:
Double click on the "chart" block and Navigate to the "Modelling" tab. Inside the "modelling" tab, select "Symbols pane" option which will evantually open the "symbols pane" on the right side of the window as shown below.
when you click on "resolve undefined symbols" icon in the "Symbols pane", the simulink automatically assigns a "TYPE" to it.
In your case, the "type" property of undefined symbol might have been set to "Input Data". This is the reason behind an additional "input" port being created on the state-flow.
solution:
As shown in the below figure, set the "type" property of the unresolved symbol to "local data"
By configuring the "TYPE" of a variable as "local data",that variable becomes "local" within the block and it will be seen only inside the "chart" block. Now you observe that the input port will not be there in your state-flow.
I hope this helps !

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!