HOW CAN I PLOT THIS?

조회 수: 2 (최근 30일)
Pul
Pul 2021년 7월 1일
댓글: Pul 2021년 7월 3일
Hello, I'm not able to plot this even if I converted the data I need in table.
Could anyone kindly help me please?
Thank you!
clear all
close all
load('GIULIA_MMEQ1.mat');
A=table2array(GIULIAMMEQ1(:,2));
B=str2double(A);
giulia_MM_EQ_NEW= B * 0.35 * 10;
C=array2table(GIULIAMMEQ1);
stackedplot(GIULIAMMEQ1.Dec1997,C)

채택된 답변

Amit Bhowmick
Amit Bhowmick 2021년 7월 1일
Please check and confirm the correction
clear all
close all
clc
load('EXAMPLE.mat');
A=GIULIAMMEQ1.Var4%table2array(EXAMPLE(:,2)); EXAMPLE.mat contains GIULIAMMEQ1 instead of table EXAMPLE
B=str2double(A);
NEW= B * 50 * 20;
C=GIULIAMMEQ1.Var4%array2table(EXAMPLE);% TABLE EXAMPLE MISSING
% plot(EXAMPLE.Dec1997,C)
stackedplot(GIULIAMMEQ1)
  댓글 수: 9
Pul
Pul 2021년 7월 2일
I get the same error!
Pul
Pul 2021년 7월 3일
I found out the error: I have to put 'dd MMM yyyy'.
Last quick question: how can I delete "Column 1" that appear in the y-axis and giving it another label?
Because I get this error:
Thank you.

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

추가 답변 (2개)

David Hill
David Hill 2021년 7월 1일
load('EXAMPLE.mat');
m=table2array(GIULIAMMEQ1);
d=datenum(m(:,1));
v=str2double(m(:,2));
idx=~isnan(v);
plot(d(idx),v(idx));
  댓글 수: 6
Amit Bhowmick
Amit Bhowmick 2021년 7월 2일
Use stackedplot instead of plot for the correction on x axis leveling
Pul
Pul 2021년 7월 2일
Even If I use stacked plot, I don't have years on the x-axis.

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


Pul
Pul 2021년 7월 2일

I get this error if I try in that way.

  댓글 수: 4
Amit Bhowmick
Amit Bhowmick 2021년 7월 3일
T=table(C,NEW,'Variablenames',{'Year' 'Value'}); %Put label
stackedplot(T,'XVariable','Year') %
Pul
Pul 2021년 7월 3일
Thank you!

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

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by