How to plot the value of a matrix?

Hi, I have a matrix 7x21 double, there is a way to plot the result with this imput:
x axis: the columns
y axis: the rows

 Accepted Answer

plot(yourMatrix)

4 Comments

Yeah, I tried but It does not open the plot
srcFile = dir('C:\Users\agnes\Pictures\POST PROCESSING 4\PP4 TGC-MED RD 100\*.dcm');
pathname = ('C:\Users\agnes\Pictures\POST PROCESSING 4\PP4 TGC-MED RD 100\');
numberofimages = 21;
numberofroi = 2;
I=dicomread('2');
imshow(I)
R = nan(numberofroi,4);
masks=cell(numberofroi,1);
for nr = 1:numberofroi
h = drawrectangle(gca); wait(h);
R(nr,:)=h.Position;
masks{nr}=h.createMask;
end
roibasket = cell(numberofroi,numberofimages);
meanbasket = nan(size(roibasket));
for ni = 1:numberofimages
for nr = 1:numberofroi
filename=(num2str(ni));
pileofimages=dicomread(strcat(pathname,filename));
info=dicominfo(strcat(pathname,filename));
roibasket{nr,ni} = imcrop(pileofimages,R(nr,:));
meanbasket(nr,ni) = mean( pileofimages(masks{nr}) );
devstdbasket (nr,ni) = std2 ( pileofimages(masks{nr}) );
end
end
for use = 1: numberofimages
Mu = meanbasket(:, use);
M2 = meanbasket;
M2(:, use) = NaN;
th = devstdbasket(:,use);
for i = 1 : length(Mu)
mi = Mu(i);
di = abs(M2 - mi);
[r, c] = find(di <= th);
fprintf('\n\nLa %da ciste della immagine %d vale %d\n', i, use, mi);
if length(r) < 1
fprintf('\n No value found!');
else
fprintf('\n I find the same value!\n');
end
for j = 1 : length(r)
fprintf('\nM(%d,%d)=%d', r(j), c(j), meanbasket(r(j), c(j)));
end
end
end
plot (meanbasket) %Why it does not work?
@Agnese Chini, you forgot to attach 2.dcm. Please use the paperclip icon to attach it so we can run your code.
I can not, because is a dicom image. A dicom image can't be attach right here. Can't you just chek why does not plot? Because the code befor the latest line does the work
It is not obvious from the posted code why it does not plot. The simplified code below is something you can easily run to prove to yourself that it should work.
meanbasket=rand(4,7);
plot(meanbasket); legend

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2020b

Asked:

on 26 Sep 2021

Edited:

on 26 Sep 2021

Community Treasure Hunt

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

Start Hunting!