Using an existing vector in a .M file
3 views (last 30 days)
Show older comments
Hello! I've made a simple function file and let's say I need to input a vector (50 elements) so that a function gives me the resulting vector for those elements. I have the vector in the workspace but when I try to use it as an input (instead of for example introducing the input like this [1 2 3 4 5... 50]) the vector is not recognised as a valid entry and is as if i hadn't introduced nothing. How could I solve this? Is a problem in the script? I have it as:
P_k='Introduce the 50 values';
P_k=input(P_K);
I'm new into this and I really don't know how can I solve this and hadn't found anything related
Answers (1)
M
on 31 Aug 2018
Does this discussion https://mathworks.com/matlabcentral/answers/1748-storing-user-input-as-a-vector answer your question ?
See Also
Categories
Find more on Resizing and Reshaping 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!