Need Help With Complex Structures

Hi, I am currently working on a project where I am forecasting PV output.
I need to create a structure in Matlab that shows several predicted values for PV output at one point in time.
This is the data my structure must contain: Current Time=[1 2 3 4.....]
Now at Current Time=1, I need an another array that looks like this: Forecast Time=[2,3,4.....] Forecasted PV Output=[400,420,415......]
Then at Current Time=2,3,4..... I need to show the same data because for every point in time, there are several forecasted values.
I'm not sure how to make a structure that shows all of my data the way I need it to be displayed. If someone could please help me figure this out, I would really appreciate it!!!

4 件のコメント

José-Luis
José-Luis 2014 年 8 月 29 日
What do you mean by "displayed"?
Stacey
Stacey 2014 年 8 月 29 日
I mean I need to be able to show all of my data in one structure. That's exactly what I just said in the original post.
Image Analyst
Image Analyst 2014 年 8 月 29 日
You could use celldisp() if you use my answer below (did you even see it?).
José-Luis
José-Luis 2014 年 8 月 29 日
編集済み: José-Luis 2014 年 8 月 29 日
It might be exactly what you just said, but it was not entirely clear to me, I'm sorry. Hence my request for clarification.
There is a difference between displayed (where? on screen, in a file, in the command window) and stored (e.g. as a cell array like Image Analyst suggests).

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

回答 (1 件)

Image Analyst
Image Analyst 2014 年 8 月 29 日

0 投票

Sounds like you need a cell array rather than an array of structures. With cell arrays, each cell can contain variables of variable length. So I'd have a N by 2 cell array, where the cells in column 1 contain the ForecastTime arrays, which could all have different lengths, and the second column would contain the ForecastedPVOutput arrays, again which could have different lengths in each row. The row corresponds to the "current time". See the discussion of cell arrays in the FAQ: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F

カテゴリ

ヘルプ センター および File ExchangeStructures についてさらに検索

タグ

質問済み:

2014 年 8 月 29 日

編集済み:

2014 年 8 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by