matrices converted problem into code
이전 댓글 표시
I am trying to convert the matrices A 3by 3, B randsample 3by3, C 3by2 converted into the code then run script, which always got wrong answer said undefined solution or invalid expression, check for missing or extra character. Can any one help me out with this? Best regard!
B = [1.8,2.8,0.3;randsample(0.1:0.1:0.9,1),-0.9,0.0;-0.1,1.0,2.3];
A = [5,-4,2;1,5,4;-6,-1,-3];
C = [3,6;4,-5;5,0];
ans1=B+A;
ans2=A*B;
ans3=B*A;
no 'ans4'
no 'ans5'
no 'ans6'
ans7=A*C;
ans8=5*(A+B);
ans9=A+B;
ans10=(5*A)+(5*B);
답변 (1개)
Walter Roberson
2022년 8월 26일
no 'ans4'
That would be a problem unless you happened to have defined a function no.m that accepted a character vector parameter.
Your code image has
ans4=
with nothing else on the end of the line. That is not valid syntax. If you want ans4 to exist but be empty, use either
ans4=[]
or
ans4=''
카테고리
도움말 센터 및 File Exchange에서 Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!