how to save the values

how to save the all values of latent in the set of images if i run the code only the 7 image values only save how to reslove the problem
clc
clear all;
warning off all;
for loop=1:7
figname=strcat(sprintf('CLL (%d).png',loop));
img=double(imread(figname));
[pc, score,latent,tsquare] = princomp(img);
latent=latent(1:400,:);
latent=latent';
end

 Risposta accettata

Andrei Bobrov
Andrei Bobrov il 3 Giu 2013
Modificato: Andrei Bobrov il 3 Giu 2013
latent = zeros(7,400);
for loop=1:7
figname=strcat(sprintf('CLL (%d).png',loop));
img=double(imread(figname));
[~,~,l0] = princomp(img);
latent(loop,:) = l0(1:400).';
end

7 Commenti

ajith
ajith il 3 Giu 2013
Modificato: ajith il 3 Giu 2013
sir how to perform these actions
latent=latent(1:400,:);
latent=latent';
.
.
.
latent7=latent7(1:400,:);
latent7=latent7';
q=[latent;latent1;latent2;latent3;latent4;latent5;latent6;latent7;];
Andrei Bobrov
Andrei Bobrov il 3 Giu 2013
see my answer
out = cell(7,3);
for loop=1:7
figname=strcat(sprintf('CLL (%d).png',loop));
img=double(imread(figname));
[out{loop,:}] = princomp(img);
end
s=out{1,3};s=s(1:400,:);s=s';
s1=out{2,3};s1=s1(1:400,:);s1=s1';
s2=out{3,3};s2=s2(1:400,:);s2=s2';
s3=out{4,3};s3=s3(1:400,:);s3=s3';
s4=out{5,3};s4=s4(1:400,:);s4=s4';
s5=out{6,3};s5=s5(1:400,:);s5=s5';
s6=out{7,3};s6=s6(1:400,:);s6=s6';
q=[s;s1;s2;s3;s4;s5;s6;];
from your prefered link i find how to access the cell... i need to know using the loop its possible to find the 'q' is possible or not sir
ajith
ajith il 3 Giu 2013
Mr. Andrei Babrov sir, using your code if its possible to change
1x400
.
.
. 1X400 into the
7X400 IS POSSIBLE SIR
Andrei Bobrov
Andrei Bobrov il 3 Giu 2013
Modificato: Andrei Bobrov il 3 Giu 2013
answer as corrected
ajith
ajith il 4 Giu 2013
thanks a lot sir

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by