- concatenate values together values using square brackets: A = [1,2,3;4,5,6];
- assign the output of a fucntion: A = fun(...);
- read the values from a file: A = dlmread(...);
- operate on and concatenate values using cellfun, accumarray, etc.
i want to form a matrix using certain calculated values, how to do that? is there any particular command available ?? or a program? please help.
3 views (last 30 days)
Show older comments
i have certain calculated scalar values, using which i want to form a matrix, how do i do that?
0 Comments
Accepted Answer
Stephen23
on 12 Mar 2015
Edited: Stephen23
on 12 Mar 2015
Your question is far to general to give a specific answer: the name MATLAB comes from MATrix LABoratory, so of course there are many ways that you can define matrices. You don't say anything about how you "have certain calculated scalar values", so how are we supposed to know if these are already assigned to variables, or are in some cell array or structure, or are the outputs of calculations that you have performed in the command window?
If you are learning about MATLAB then you should work through all of these tutorials, which cover such basic concepts as how to create a matrix:
There is not enough time in our lives to teach every beginner the first baby-steps of MATLAB. You need to put in that effort yourself, and you will also learn more.
To answer your question: some basic methods are
2 Comments
Stephen23
on 13 Mar 2015
Edited: Stephen23
on 13 Mar 2015
We can help you, but you still need to give us a bit more to work with here... in your explanation it is not clear how these various matrices are related: you start with X with size 2x3, add two to get Y=X+2, but then how does this "form 10 other matrices as such"? I see only two so far: X and Y.
A much more detailed explanation would us understand what you are doing, and then we could help in return. You should upload your attempt so far (please as a file, not as text here), and write a more detailed explanation.
More Answers (0)
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!