how can printing in 5 shapes (using a plot function) how the values for each product (or country) change. In the title of each shape, display the name of the product with this values( the values inside excel file)

3 visualizaciones (últimos 30 días)
hi
thank you but doesnt works look i have this code:
if i run it he ask me what of all these function use i type two bcs my problem is it.After matlab starting and runing the second function [Y] = plotProducts(X,Names)
and my problem is how can printing in 5 shapes (using a plot function) how the values for each product (or country) change. In the title of each shape, display the name of the product with this values( the values inside excel file)
%TELIKO PROJECT
% Author: Andreas Moisidis
% date: 22/4/21
filename = 'data.csv'; %filename of data file
%Ôï áñ÷åßï ðñÝðåé íá Ý÷åé 5 ãñáììÝò êáé 20 óôÞëåò üðùò ôï data.csv
X = csvread(filename); %Reading the data
%Ïíüìáôá ðñïúïíôùí - èá ÷ñåéáóôåß åäþ íá âÜëåôå ôá äéêÜ óáò
Names{1} = 'xiaomi redmi note 9';
Names{2} = 'xiaomi redmi 9c';
Names{3} = 'huawei p smart 2020';
Names{4} = 'xiaomi redmi 9';
Names{5} = 'samsung galaxy A21';
N = size(X,1); %N = 5
M = size(X,2); %M = 20
%èá ÷ñåéáóôåß íá áëëÜîåôå ôï ðáñáêÜôù ìýíçìá s óýìöùíá ìå ôçí åêöþíçóç
s = sprintf('Dwse 0 gia exit,\n 1 gia ektelesh ths getCurrentAverage, \n 2 gia ektelesh ths plotproduct , \n 3 gia ektelesh ths sortproduct , \n 4 gia ektelesh plotbestmodel , \n 5 gia ektelesh getCorrelated');
ok = 1;
while ok ~= 0,
ok = input(s);
a
%èá ÷ñåéáóôåß íá áëëÜîåôå ôïí ðáñáêÜôù êþäéêá óýìöùíá ìå ôçí åêöþíçóç
if ok == 0,
disp('Exit');
elseif ok == 1,
[YC,YMIN,YMAX,YA] = getCurrentMinMaxAverage(X,Names);
elseif ok == 2,
[Y] = plotProducts(X,Names);
elseif ok == 3,
[Y] = sortProducts(X,Names);
elseif ok == 4,
[Y] = plotBestModel(X,Names);
elseif ok == 5,
[a,b,c,d] = getCorrelated(X,Names);
else
disp('La8os eisodos');
end
end
-------------------------------------------------
function [Y] = PlotProduct(X,Names)
for N = 1: 5;
figure;
plot(X);
title(Names{N});
xlabel('PRICES');
end

Respuestas (0)

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by