how to use matrix of three variables

조회 수: 3 (최근 30일)
muhammad ismat
muhammad ismat 2016년 4월 30일
답변: CS Researcher 2016년 5월 1일
firstly i was used matrix s(n x n) where n x n is the size of data in the following code
A = yarbb(data,x)
coordinates=data;
Av=[coordinates; fliplr(coordinates)];
linindices = sub2ind(size(s), Av(:, 1), Av(:, 2))';
remain=setdiff(1:numel(s), linindices);
sim=s(remain);
.
.
auc= (ndash + 0.5 * nddash)/(ndash+nddash+nn);
A=means(auc)
but then i edit s(n x n) to become smit(n x n x p) where p is the max value of loop was used in other function so i want to use every value of smit as s (p times) in previous code say smit is (77 x 77 x 10) i want to use smit as (77 x 77) 10 times in previous code because smit is changed every time.
  댓글 수: 3
CS Researcher
CS Researcher 2016년 5월 1일
Not sure what you want but something like this:
final3DMatrix = zeros(77,77,10);
for i = 1:10
final3DMatrix(:,:,i) = smit; %smit is 77x77
end
Geoff Hayes
Geoff Hayes 2016년 5월 1일
CS Researcher - your above comment seems to provide the solution to the posed question, so please copy and paste as an answer.

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

답변 (1개)

CS Researcher
CS Researcher 2016년 5월 1일
Not sure what you want but something like this:
final3DMatrix = zeros(77,77,10);
for i = 1:10
final3DMatrix(:,:,i) = smit; %smit is 77x77
end

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by