hello, I am stuck at this part of my code

1 回表示 (過去 30 日間)
Christian Benjamin
Christian Benjamin 2022 年 12 月 12 日
回答済み: Dongyue 2022 年 12 月 15 日
I have to use specific data gathered in a generated cell array to properly output the data sets.
this is what i have so far
Data is the generated matrix that i have to gather data from. its size differs depending on what genre is being shown. i need help with figuring out how to splice out the specific row that corresponds with what the user wants to watch (the values in my first column that they can choose) in order to output data points from said row. i've also attached the code and excel file i am working from
MoviesinGenre = Data
Moviegenrechoice = input('Which movie do you want to watch\n(Pick one of the movie names in the given matrix)','s')
while strcmpi(MoviesinGenre(:,1),'Moviegenrechoice')
Moviegenrechoice = input('Error. Pick a movie listed in the array')
end
fprintf('The movie you have chosen is %s.\n',Moviegenrechoice)
Moviegenrechoicerow = MoviesinGenre(Moviegenrechoice,:)
  1 件のコメント
Image Analyst
Image Analyst 2022 年 12 月 12 日
I'm not seeing where you attached Data.
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:

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

回答 (1 件)

Dongyue
Dongyue 2022 年 12 月 15 日
Hi Christian,
I have updated your script, please check the attached file.
BTW, I still recommend you to use the table instead of the cell to do the data visiualization. It is much easier to use table for indexing and data processing.
Please read through the documentation for Data Table,
Best,
Dongyue

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by