フィルターのクリア

Error using the Matlab function block in Simulink

3 ビュー (過去 30 日間)
Sameer
Sameer 2015 年 6 月 30 日
編集済み: Azzi Abdelmalek 2015 年 7 月 3 日
Hello,
I am trying to use a matlab function block but the function I wrote is giving me an error when used inside the matlab function block, on the other hand the same function is running perfectly when run normally (not using the matlab function block).
function Schritte = Ablaufschritt(Schrittnummer,Ablaufplan)
%#codegen
Z=0;
V=size(Ablaufplan,1);
switch(Z+Schrittnummer)
case Z
if Z==V
Schritte=[Ablaufplan(Z+Schrittnummer,2:end),1];
elseif Z>V
Schritte=[Ablaufplan(1,2:end),0];
else
Schritte=[Ablaufplan(Z+Schrittnummer,2:end),0];
end
end
end
where Schritnummer is a single number and Ablaufplan is a matrix of 15*9.
I am getting the following error
It will be great if anyone can help me to find out the mistake.
Thanking you in anticipation
Best Regards

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2015 年 6 月 30 日
  2 件のコメント
Sameer
Sameer 2015 年 6 月 30 日
Hello thank you for replying. As per my knowledge the error I am getting and the links you sugessted are not linked. Can you please help further....
Regards
Azzi Abdelmalek
Azzi Abdelmalek 2015 年 7 月 3 日
編集済み: Azzi Abdelmalek 2015 年 7 月 3 日
Why switch(Z+Schrittnummer) ? you ca just use
if Z==V
Schritte=[Ablaufplan(Z+Schrittnummer,2:end),1];
elseif Z>V
Schritte=[Ablaufplan(1,2:end),0];
else
Schritte=[Ablaufplan(Z+Schrittnummer,2:end),0];
end

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeString についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by