multiply a number to only a row in a matrix
23 次查看(过去 30 天)
显示 更早的评论
- o =
- 3×16 logical array
- 1 1 0 0 1 1 1 0 1 0 1 1 1 1 0 1
- 0 0 1 0 1 0 1 0 1 1 1 0 1 1 1 0
- 1 1 0 1 0 0 1 1 0 1 1 0 0 0 0 1
- volts0 = ((-5 + 10*(out_data))*0.35)
- volts0 =
- Columns 1 through 12
- 1.7500 1.7500 -1.7500 -1.7500 1.7500 1.7500 1.7500 -1.7500 1.7500 -1.7500 1.7500 1.7500
- -1.7500 -1.7500 1.7500 -1.7500 1.7500 -1.7500 1.7500 -1.7500 1.7500 1.7500 1.7500 -1.7500
- 1.7500 1.7500 -1.7500 1.7500 -1.7500 -1.7500 1.7500 1.7500 -1.7500 1.7500 1.7500 -1.7500
I am trying to do the multiplication only on row1 but when I execute the syntax for volts0 it takes the entire matrix. How should I write this piece if I want to perform the multiplication only to row 1
Similarly i am trying to do for row 2 and 3 but with different numbers
please help
0 个评论
回答(2 个)
madhan ravi
2018-11-17
volts0(1,:)*4 % here first row is multiplied by a scalar number like you wanted
2 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!