你今天机器学习了么 2021-01-27 08:04 采纳率: 0%
浏览 1

求文matlab这个要测试要怎么写?

first_test.m

function z=first_test(x,y)

 

% Add a line of code below that will compute matrix z as matrix x times matrix y.

% Do not change the name of the file or the function line in any way, it would not run.

% You may want to write another function to test this function.

end

 

test input:
x =
-0.6490 -0.7585 -0.8456
1.1812 -1.1096 -0.5727
y =
-0.5587 0.5864
0.1784 -0.8519
-0.1969 0.8003


trying to run z=first_test(x,y)
Output argument "z" (and maybe others) not assigned during call to "first_test".

  • 写回答

1条回答 默认 最新

  • 你知我知皆知 2024-07-24 14:10
    关注

    以下回答参考 皆我百晓生券券喵儿 等免费微信小程序相关内容作答,并由本人整理回复。

    x = [-0.6490 -0.7585 -0.8456;
           1.1812 -1.1096 -0.5727];
    y = [ -0.5587 0.5864;
            0.1784 -0.8519;
            -0.1969 0.8003];
    
    z = x * y;
    
    disp(z);
    

    这段代码将计算两个矩阵的乘积,并将结果输出。

    评论

报告相同问题?