creating a new column in a matrix using 'if condition"
2 ビュー (過去 30 日間)
古いコメントを表示
On the following matrix:
![Untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/216747/Untitled.png)
I am using the following code which is not giving the right response.
if Reg1(:,3)==0
Reg1(:,10)=0;
else
Reg1(:,10)=a1-b1*Reg1(:,3)+Reg1(:,6);
end
Cannot figure out the issue.
The output is
![Untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/216752/Untitled.png)
1 件のコメント
Catalytic
2019 年 4 月 26 日
We have no way of knowing what you consider to be the "right response"....
採用された回答
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!