creating a new column in a matrix using 'if condition"
3 views (last 30 days)
Show older comments
On the following matrix:
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
1 Comment
Accepted Answer
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!