Error Inputing Data for a 3-D Histogram

I am trying to create a 3D histogram. I am plotting calculated standard deviations for 30 cell positions (x and y with z being standard deviations calculated for each cell position (x,y)). if I could get help with my coding that would be great. I've only been using Matlab for a short time.

2 件のコメント

Star Strider
Star Strider 2018 年 3 月 29 日
‘... an error message keeps popping up.
We cannot see it from here.
It would help to know what it says.
Elysia Salas
Elysia Salas 2018 年 3 月 29 日
I have edited the question to show the error.

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

 採用された回答

Star Strider
Star Strider 2018 年 3 月 29 日

0 投票

You have to put single quotes around the file name:
D = load('Peak 1 Matlab Data Insert.xlsx');
I always use the function form of load, and I always use it with an output. You can assign the variables later from the ‘D’ structure (in this example).

4 件のコメント

Elysia Salas
Elysia Salas 2018 年 3 月 29 日
編集済み: Star Strider 2018 年 3 月 29 日
I used this command and was able to import data. However, now I am having trouble actually making a 3D histogram.
Star Strider
Star Strider 2018 年 3 月 29 日
The argument to hist3 must be an ‘m x 2 numeric matrix’, according to the documentation. It apparently does not support table data types. I would use the table2array (link) function, and then give the output of that to hist3.
Elysia Salas
Elysia Salas 2018 年 3 月 29 日
After doing so, I'm still getting errors on generating the 3D histogram. What can I do? --Also want to thank you so much for your help!!
Star Strider
Star Strider 2018 年 3 月 29 日
As always, my pleasure!
The documentation says that the argument matrix must be a ‘m by 2 numeric matrix’, so if you have more than 2 columns, you can only plot one histogram for each 2-variable, 2-column pair.
One ingenious way of ‘stacking’ several such histograms (if this approach works for your data) is in Define bar3() colors with hold on (link). I offer it as a possible solution to your problem. (My contribution to that effort was to get the plot to work correctly.)

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

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by