Converting 1x1 matrix into 200x1 with same value?
2 次查看(过去 30 天)
显示 更早的评论
Hello, I am creating GUI where I want user to put inputs. The input value will be as single number. Say 500.
My code is time dependent. Which means it is having loops which goes till 200 seconds. And calculates value at every second.
So I want to get single input from user and convert it into 200x1 matrix form so the code works properly.
Can anyone suggest me anything?
0 个评论
采纳的回答
James Tursa
2015-4-23
myVector(1:200,1) = singleValue;
5 个评论
Stephen23
2015-4-23
编辑:Stephen23
2015-4-23
I apologize that you felt that I was being sarcastic, but actually we often provide links for people to learn new things, and those tutorials happen to be an excellent resource for beginners. Please consider doing them.
You comment and further question "Now how to use your code...?" could be used something a bit like this:
>> Temp = 500;
>> myVector(1:200,1) = Temp;
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!