Slicing a matrix into multiple matrices

3 ビュー (過去 30 日間)
Deepa Maheshvare
Deepa Maheshvare 2019 年 10 月 20 日
回答済み: Matt J 2019 年 10 月 20 日
I would like to slice a matrix and create multipke matrices out of it.
For example,
I've the following matrix
A =rand(10,8)
I would like to slice A based on length of the list N and value of R.
Where,
N = ['a', 'b', 'c', 'd']
R = 2
The expected output is
A.a = A(:,R)
A.b = A(:, R+1: 2*R)
A.c = A(:, 2*R+1 : 3*R)
A.d = A(:, 3*R+1: 4*R)
I'd like to know if there is a better way to implement this.

回答 (1 件)

Matt J
Matt J 2019 年 10 月 20 日

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

タグ

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by