Colorbar not supported in Simulink "MATLAB function" surf plot

I have a custom surf plot written into a "MATLAB function" in simulink environment and I add the 'colorbar' in the plot to see the color division.
However I get the following error, related to the "colorbar" command:
Function 'colorbar' not supported for code generation.
Function 'Beam/MATLAB Function' (#46.1201.1209), line 36, column 60:
"colorbar"
Launch diagnostic report.
Component:MATLAB Function | Category:Coder error
How can I add a colobar to my simulink MATLAB function without get such error?

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 6 月 4 日
編集済み: Ameer Hamza 2020 年 6 月 4 日

0 投票

Add this line
coder.extrinsic('colorbar')
in the MATLAB function block before the colorbar line.

2 件のコメント

Alberto Mora
Alberto Mora 2020 年 6 月 4 日
Thank you very much!
Ameer Hamza
Ameer Hamza 2020 年 6 月 4 日
I am glad to be of help!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

製品

リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by