if I want to call the firts column of the data.timepoints how can I do that? I mean the "time" column.
I really appreciate any help.

 채택된 답변

Jon
Jon 2019년 8월 9일
편집: Jon 2019년 8월 9일

0 개 추천

I'm not sure exactly what you mean by "call the first column of the data.timepoints"
If you wanted to assign some other variable (I'm not sure why you would want to do this) to hold the time values you could use, for example
t = data.timepoints.time
If you wanted to perform some mathematical operation on the vector of times you could do it directly for example
y = 2*data.timepoints.time + 10
If this is not what you are asking, then can you please clarify. Best is to give a simple example (short piece of code to demonstrate) of what you are trying to do, explain the problems that you encounter, and copy and paste the full text of any error messages that you encounter

댓글 수: 7

Jon
Jon 2019년 8월 9일
편집: Jon 2019년 8월 9일
Sorry I didn't look closely enough at your screen shot to realize there was one more level of nesting. As indicated by @madhan ravi so you should refer to the times as data.timepoints.time rather than just data.timepoints. To avoid confusion I have edited my original post accordingly to give the correct name. I would suggest accepting @madhan ravi's answer if that is all you are asking.
Thanks for your help. How can I choose the one the first row in the data.timepoints.time? I mean choosing time "0". I tried data.timepoints.time{1} and data.timepoints.time(1) both gave me error.
I also need to use this in a loop and do some calculations, how can I find the range of the data.timepoints.time? Here the range is 6 but it might change. I wanted to have some basic syntaxed to work with structures. I checked here but did not answer my question.
madhan ravi
madhan ravi 2019년 8월 9일
Mind uploading the data as .mat file?
Jon
Jon 2019년 8월 9일
편집: Jon 2019년 8월 9일
With the structure you show in your screen shot you should be able to retrieve the first element of time using
t0 = data.timePoints.time(1)
What error did you get? As @madhan ravi says it would be helful if you uploaded your variable data so we could try
You should be able to get the number of elements in your time vector using
length(data.timePoints.time)
The error is get is : Expected one output from a curly brace or dot indexing expression, but there were 6 results.
madhan ravi
madhan ravi 2019년 8월 9일
Zeynab, will you attach your data ???
It is huge data and I did some precalculations. I was trying to put all structure in an excel file to send it here but I got the error that it is huge. Any suggestion?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

madhan ravi
madhan ravi 2019년 8월 9일
편집: madhan ravi 2019년 8월 9일

0 개 추천

[data.timepoints.time]

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by