corr2 on simulink don't code genaration
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
The function 'corr2' is not supported for standalone code generation. See the documentation for coder.extrinsic to learn how you can use this function in simulation.
what function can replace this function on the simulink simulation?
採用された回答
Birdman
2017 年 10 月 18 日
There is the necessary function and its embedded model in a MATLAB Function in Simulink. Hope this helps. You need to have the m file and the model at the same directory.
11 件のコメント
tsai kai shung
2017 年 10 月 19 日
thanks your help
tsai kai shung
2017 年 10 月 19 日
sorry i use this function run on the matlab show the error message: Error using * Inner matrix dimensions must agree.
Error in Corr3 (line 5) rNum(i)=((A(i)-A_0)*(B(i)-B_0));
Error in OCR (line 55) sem=Corr3(templates(1:42,n:n+23),img_r);
Birdman
2017 年 10 月 19 日
It should work just fine. Make sure that arrays are the same length
Walter Roberson
2017 年 10 月 19 日
It looks to me like the inputs must be vectors?
Birdman
2017 年 10 月 19 日
The inputs are vectors.
tsai kai shung
2017 年 10 月 19 日
my input is array!so how to change this function
Birdman
2017 年 10 月 19 日
Define nx1 array, which means vector.
tsai kai shung
2017 年 10 月 19 日
how to define
tsai kai shung
2017 年 10 月 19 日
編集済み: Walter Roberson
2017 年 10 月 19 日
function r = Corr2(A,B)
A = A - mean2(A);
B = B - mean2(B);
r = sum(sum(A.*B))/sqrt(sum(sum(A.*A))*sum(sum(B.*B)));
end
i use this can normal run
Birdman
2017 年 10 月 19 日
A=[1 2 3 4] and B=[3 4 5 6]. In constant block in simulink, just type the array, don't write A=[1 2 3 4]. Write [1 2 3 4] only.
tsai kai shung
2017 年 10 月 20 日
i use the BWimage input
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Simulink についてさらに検索
タグ
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)