How to create a 100x1 vector variable called b such that the vector b is equal to -5
Show older comments
Create a 100x1 vector variable called b such that the vector b is equal to -5
3 Comments
Ibrahim Chalhoub
on 1 Sep 2016
How would I solve Ax=b? What would be the approach?
Walter Roberson
on 1 Sep 2016
Use the \ operator. For example,
A = rand(5,8);
b = -5 * ones(5, 1);
A\b
Answers (1)
Walter Roberson
on 31 Aug 2016
One approach:
b = zeros(100,1);
b(:) = -5;
Another approach:
b(1:100,1) = -5;
Another approach:
b = -5 * ones(100,1);
Categories
Find more on Mathematics 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!