how can i create a matrix in a loop and have some elements changing with every iteration
Show older comments
I want to create a 10 by 10 matrix in a loop and have some elements changing between a particular range of values for each iteration.
4 Comments
Stephen23
on 4 Jul 2018
@Folakemi Omotoye: your question is very general and lacking any specific information that it will be hard for anyone to give advice. Please give more concrete examples and/or explanations of what you are trying to achieve.
Folakemi Omotoye
on 4 Jul 2018
Stephen23
on 4 Jul 2018
@Folakemi Omotoye: can you please give an example.
Stephen23
on 4 Jul 2018
n=9;
for k=1:n
m{k}=1*k+ones(10)% to create 10 by 10 matrix
disp(m{k}) % to display matrix outcome for kth iteration
end
i need to include a line to change the values of some of the pixels. I do not know how to do that.
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements 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!