Create heatmap from table, error "'XVariable' value must reference a single variable in the source table."

10 ビュー (過去 30 日間)
Anna
Anna 2021 年 2 月 21 日
コメント済み: Anna 2021 年 2 月 22 日
Hello,
I have a problem when trying to create a heatmap from this table
I want the y axis to display the IDs and the x axis to display the 6 different Snacks, the table is about the Liking mean_rating of the IDs for the snacks (nevermind the phases column).
When I try to create a heatmap with
heatmap(data_mean_liking, data_mean_liking.Snack, data_mean_liking.ID)
it gives me the following error: "'XVariable' value must reference a single variable in the source table."
I don't really understand the error message or how to display the heatmap I want.
Thanks for the help!
Edit: I have included part of the table for trying out.

回答 (1 件)

dpb
dpb 2021 年 2 月 21 日
The x,y variables for a table are given as the names of the wanted columns; the dot notation returns the data.
heatmap(data_mean_liking, 'Snack', 'ID')
  7 件のコメント
dpb
dpb 2021 年 2 月 22 日
The issue is that the heatmap function will count every element as different even if the average rating differs by only machine epsilon--it is every unique cross-comparison which almost certainly will end up also be 1:1 for each cell just as is the ID.
Are the 'phases' discrete rankings or independent trials or what?
However you try to agglomerate over levels will be some loss of individual precision, yes, but that's the price you'll have to pay to be able to summarize across multiple snacks/individuals to show trends instead of every separate evaluation as one observation.
I don't see a way around that.
Anna
Anna 2021 年 2 月 22 日
There are four discrete phases and in each phase participants can rate a snack between on a continuous scale of (I think) -100 and +100.
Ok, thank you for your help so far! I will check on how to work with this then.

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

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by