So this is the question from my college assignment;
Create a 500-element column vector P17M11 containing two hundred number 17's and followed by three hundred -11's
If I wanted to create separate columns for 17's and -11's, how would I write them so they can combine nicely?

 채택된 답변

Stephen23
Stephen23 2017년 4월 9일
편집: Stephen23 2017년 4월 9일

0 개 추천

The assignment does not ask for 500 columns, but one column with 500 elements: "500-element column vector".
P17M11 = vertcat(17*ones(200,1),-11*ones(300,1))
You can learn these kind of basic MATLAB operations by working through the introductory tutorials:

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

질문:

2017년 4월 9일

댓글:

2017년 4월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by