hello, I am stuck at this part of my code

1 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by