how to resize a matrix?

조회 수: 6 (최근 30일)
trailokya
trailokya 2014년 11월 20일
댓글: trailokya 2014년 11월 22일
I have a matrix A of dimension 129*135. I want to make it 135*135 by adding some NaN values. How is it possible in a simple way?

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 11월 20일
편집: Azzi Abdelmalek 2014년 11월 20일
a=rand(129,135) % Example
a(end+1:135,:)=nan
  댓글 수: 3
Azzi Abdelmalek
Azzi Abdelmalek 2014년 11월 20일
The same thing
a=rand(129,135,33);
a(end+1:135,:,:)=nan
trailokya
trailokya 2014년 11월 22일
thank you sir

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

추가 답변 (1개)

Phillip
Phillip 2014년 11월 20일
Hi
There are a number of ways you can do this. At the command prompt type:
help vertcat
and
help nan
This will get you started. Matlab's very powerful at indexing etc. So reading through the basic tuturials and examples will get you started quickly
Regards, Phil
  댓글 수: 1
trailokya
trailokya 2014년 11월 20일
thanks :)

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

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by