Kindly help me solve this problem...

1 回表示 (過去 30 日間)
Umair Ejaz
Umair Ejaz 2022 年 9 月 5 日
回答済み: Ronny Jimenez 2024 年 5 月 17 日
load("stormData");
summaryRegionCosts = groupsummary(stormData, 'Region',{"min","max","median","mean"} , 'Total_Cost');
stormDataPos = stormData.Total_Cost> 0 ;
summaryRegionPosCosts = groupsummary(stormData, 'Region', {"min","max","median","mean"},'stormDataPos');

回答 (2 件)

Sailesh Kalyanapu
Sailesh Kalyanapu 2022 年 9 月 8 日
As per my understanding you are trying to use 'groupsummary' function to create a table to show the min, max, median and mean total cost by region for the subset of data which has total cost greater than zero.
It seems that the input arguments are being passed incorrectly in the (line 4) of your solution
% This modification would solve the issue
summaryRegionPosCosts = groupsummary(stormDataPos, 'Region', {"min","max","median","mean"},'Total_Cost');
For more information on ‘groupsummary’, please refer to the below link to its documentation:
  1 件のコメント
Umair Ejaz
Umair Ejaz 2022 年 9 月 8 日
STILL ERROR

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


Ronny Jimenez
Ronny Jimenez 2024 年 5 月 17 日
Here's the code.
summaryRegionCosts = groupsummary(stormData, 'Region',{"min","median","median","mean","max"},'Total_Cost');
stormDataPos = stormData(stormData.Total_Cost > 0,:);
summaryRegionPosCosts = groupsummary(stormDataPos, 'Region',{"min","median","median","mean","max"},'Total_Cost')

カテゴリ

Help Center および File ExchangeDatabase Toolbox についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by