matrix addition and substraction
显示 更早的评论
{a1; a2; 0}
i want to R1-R1 and R2+R1
回答(1 个)
@pramod kumar What ou ask is a very basic question. I would suggest you to take a basic introductory course in MATLAB.
Your question is simple.
% random matrix for demo
a1 = rand(15,1) ;
a2 = rand(15,1) ;
% add
a = a1+a2 ;
% subtract
b = a1-a2 ;
5 个评论
Chaudhary P Patel
2022-1-31
KSSV
2022-1-31
% random matrix for demo
a1 = rand(15,1) ;
a2 = rand(15,1) ;
id1 = 1:length(a1)-1 ;
id2 = 2:length(a1) ;
a = a1(id1)+a1(id2) ;
b = a1(id1)-a1(id2) ;
Chaudhary P Patel
2022-1-31
编辑:KSSV
2022-1-31
KSSV
2022-1-31
This will throow error. It will not yun, as a is a scalar and you are trying to access it a svector.
Chaudhary P Patel
2022-1-31
类别
在 帮助中心 和 File Exchange 中查找有关 Descriptive Statistics 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!