use*_*918 1 arrays matlab vector matrix
我想用向量替换矩阵的最后一行.
例如,我执行了以下操作并显示错误:
L = [1 2 3
4 5 6
4 6 7]
J = [1 4 6]
K = L(end,:)=J
K == find(L(:,end)=J)
?
Error: The expression to the left of the equals sign is not a valid target for an assignment
Run Code Online (Sandbox Code Playgroud)
我尝试了不同的代码但最终得到了
K = find(L(:,end)==J)
ans = 9
Run Code Online (Sandbox Code Playgroud)
我想要的结果是
K = [1 2 3
4 5 6
1 4 6] % This last row is now equal to J
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激.