make array of array like array within array

3 ビュー (過去 30 日間)
Muhammad Sohail Abid
Muhammad Sohail Abid 2018 年 10 月 1 日

I want to create an array within array. I have a m*n 2D matrix of order (256,482,2) having entries as pair of points. I want to first convert oit into 2D array and then want to make array of each row like

 for N=1 to 256
NewRow=Z(N)
Append(Points,Z(N))
End for
  1 件のコメント
Muhammad Sohail Abid
Muhammad Sohail Abid 2018 年 10 月 1 日
need help regarding code

サインインしてコメントする。

回答 (1 件)

JohnGalt
JohnGalt 2018 年 10 月 1 日
look into the 'cat' command in matlab help
  1 件のコメント
Muhammad Sohail Abid
Muhammad Sohail Abid 2018 年 10 月 1 日
actually this is the code in which I want to make arrays within arrays of Z here in Z I have a table of points. It has 256 rows so I want to make 256 arrays for each row within Z
disp('y^2 = x^3 + 5376x + 2438 mod 123457')
a=0:123456;
left_side = mod(a.^2,123457);
right_side = mod(a.^3+5376*a+2438,123457);
points = [];
for i = 1:length(right_side)
I = find(left_side == right_side(i));
for j=1:length(I)
points = [points;a(i),a(I(j))];
end
end
plot(points(:,1),points(:,2),'ro')
set(gca,'XTick',0:1:123456)
set(gca,'YTick',0:1:123456)
grid on;
pad_needed = 256 - (mod(size(points,1) - 1, 256) + 1);
if pad_needed > 0
points(end+pad_needed,:) = 0;
end
T = points;
Z = reshape(T,256,482,2);
img=rgb2gray(imread('lena.jpg'));
V=img(:);
V=V';

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

タグ

製品


リリース

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by