How to plot 3 column values in matlab from an excel sheet?

13 ビュー (過去 30 日間)
marie lasz
marie lasz 2021 年 4 月 25 日
コメント済み: marie lasz 2021 年 4 月 27 日
Hey all,
I need to plot 3 column values from excel. For example; one column contains different images, second column contains its SSIM values and third column contains different keys. on x-axis it should have keys column, on y-axis SSIM values. Can anyone guide me how to do that?
Thanks

採用された回答

Image Analyst
Image Analyst 2021 年 4 月 27 日
Try this:
% Demo by Image Analyst.
clc; % Clear the command window.
fprintf('Beginning to run %s.m ...\n', mfilename);
close all; % Close all figures (except those of imtool.)
clearvars;
workspace; % Make sure the workspace panel is showing.
format short g;
format compact;
fontSize = 20
data = readmatrix('sample_table.xls')
qualityFactor = data(:, 1);
[rows, columns] = size(data)
legendStrings = cell(columns - 1, 1);
for col = 2 : columns
thisColumn = data(:, col);
plot(qualityFactor, thisColumn, '.-', 'LineWidth', 2, 'MarkerSize', 30);
grid on;
hold on;
legendStrings{col-1} = sprintf('Image %d', col - 1);
end
legend(legendStrings, 'Location', 'southwest');
title('SSIM vs. Quality Factor for Different Images', 'FontSize', fontSize);
xlabel('Quality Factor', 'FontSize', fontSize);
ylabel('SSIM', 'FontSize', fontSize);
fprintf('Done running %s.m\n', mfilename);
  1 件のコメント
marie lasz
marie lasz 2021 年 4 月 27 日
Thank you . Thta is the thing I need.

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2021 年 4 月 25 日
data = readmatrix('my dexcel data.xlsx.')
ssimValues = data(:, 2); % SSIM values are in column 2
keyValues = data(:, 3); % Key Values are in column 3
plot(keyValues, ssimValues, 'b.-', 'LineWidth', 2, 'MarkerSize', 12);
grid on
xlabel('Key Values', 'FontSize', 20);
ylabel('SSIM Values', 'FontSize', 20);
  4 件のコメント
Image Analyst
Image Analyst 2021 年 4 月 26 日
You keep forgetting to attach 'my dexcel data.xlsx.' Please do so with the paper clip icon.
Since each row is one image, and column 2 has it's ssim and column 3 has its keyValue, how can you get an entire curve for a given image rather than just a single point??? What do the axes in your sample graph above represent???
marie lasz
marie lasz 2021 年 4 月 27 日
編集済み: marie lasz 2021 年 4 月 27 日
the image posted above is taken from a paper where y-axis defines Normalized correlation and x-axis defines quality factor of jpeg compression. Now in my case for example , for every image i have different SSIM against different Q.F. here q.F are same for every image but their SSIM values are different for every image. Sample excel data is attached below;

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

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by