MATLAB Answers

0

Dimension 2 is fixed on the left-hand side but varies on the right ([1 x 1] ~= [1 x :?])

Asked by Arkanra Kadhum on 14 Mar 2019
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 Comments

Sign in to comment.

0 Answers