How can I write a Matlab code for a flowchart, under the if and then statement ?

조회 수: 6 (최근 30일)
Kallow
Kallow 2018년 1월 9일
답변: Kaustav Khastagir 2018년 3월 30일
I want to generate a Matlab code for a flowchart that has if true or false, then... to the next step.
  댓글 수: 1
John D'Errico
John D'Errico 2018년 1월 9일
편집: John D'Errico 2018년 1월 9일
Ok. So what have you tried? Did you read the help for if? They put the documentation there for a good reason. In fact, in the docs for if, you will even find examples.

댓글을 달려면 로그인하십시오.

답변 (2개)

Manan Mishra
Manan Mishra 2018년 1월 12일
Here are a couple of workflows you can follow:
1. You can write MATLAB code for your flowchart using "if/elseif/else" statements.
Refer the documentation to know the exact syntax and some examples for these statements:
2. If you want to have C/C++ code instead of MATLAB code, you can design your flowchart using "Stateflow" and generate C/C++ code for that chart.
Refer these links for more information on this workflow:
  댓글 수: 1
Kallow
Kallow 2018년 1월 12일
Thank you Manan, will I generate the code also via the Matlab after the Stateflow or it has to be via C/C++ software ???

댓글을 달려면 로그인하십시오.


Kaustav Khastagir
Kaustav Khastagir 2018년 3월 30일
if true
% code
end

카테고리

Help CenterFile Exchange에서 Simulation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by