how to resize a matrix?

5 次查看(过去 30 天)
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

请先登录,再进行评论。

更多回答(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

类别

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