Converting 1x1 matrix into 200x1 with same value?

조회 수: 2 (최근 30일)
adi kul
adi kul 2015년 4월 23일
편집: Stephen23 2015년 4월 23일
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?

채택된 답변

James Tursa
James Tursa 2015년 4월 23일
myVector(1:200,1) = singleValue;
  댓글 수: 5
Stephen23
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;
You might like to read about indexing to know a bit more about how this works.
adi kul
adi kul 2015년 4월 23일
@Stephen Cobeldick Now this helps! Thanks a lot :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by