Dimension 2 is fixed on the left-hand side but varies on the right ([1 x 1] ~= [1 x :?])
2 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I am trying to use an Matlab function block to sort array:
function [Y1, Y2,Y3,Y4] = selectionSort( Vc1, Vc2, Vc3, Vc4, iu)
A=[ Vc1, Vc2, Vc3, Vc4];
Y1=0; Y2=0; Y3=0; Y4=0; Y5=0;
if iu >= 0
B = sort(A);
Y1=find(A==B(1),1, 'first')
Y2=find(A==B(2),1, 'first');
Y3=find(A==B(3),1, 'first');
Y4=find(A==B(4),1, 'first');
But get four errors. How can I solve these errors? Thank you for any advice. Here are the errors:
Dimension 2 is fixed on the left-hand side but varies on the right ([1 x 1] ~= [1 x :?]). Function 'MATLAB Function' (#81.264.266), line 9, column 1: "Y1"
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!