필터 지우기
필터 지우기

Subtracting two matrices of date values

조회 수: 3 (최근 30일)
Chameleon17
Chameleon17 2015년 10월 20일
편집: Chameleon17 2015년 10월 20일
Good afternoon,
I'm editing this a great deal, as I've been going round in circles with this problem all day from different angles.
Hopefully I will be able to post this and it will make sense this time. I also apologize for posting too much with simple problems.
My problem is this, I have two matrices, both 8x183 double.
Mat1:
732166 732167 732168 732169 732170 732171 732172 732173
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 732168 0 0 0 0 0
0 0 0 0 0 0 0 0
Mat2:
Columns 129 through 136
732166 732167 732168 732169 732170 732171 732172 732173
0 0 0 0 0 0 732172 0
0 0 0 0 0 0 732172 0
0 0 0 0 732170 732171 732172 0
0 0 0 0 0 0 732172 0
0 0 0 0 0 732171 732172 0
0 0 0 0 0 732171 732172 0
0 0 0 0 0 0 732172 0
The matrices are made up of zeros and date numbers. I need to keep everything in order by rows and columns. For each row I would like to find, if there is a value in the row for matrix 1, the difference in the values in matrix two for the same row. So how many dates are listed either before or after the date listed in matrix one.
As I mentioned, I've been going round in circles... and formats. I think i've confused myself. Can anybody help point me in the right direction as to how to go about this? any help as always will be very much appreciated!
Thank you for your time too!
  댓글 수: 2
Star Strider
Star Strider 2015년 10월 20일
Attach a .mat file of your cell arrays. (See the documentation for the save function for details.) Then attach them to your original Question here, first using ‘Edit’, then the ‘paperclip’ icon, completing both the ‘Choose file’ and ‘Attach file’ steps.
We can’t provide any reliable solutions without having at least a sample of your data.
Chameleon17
Chameleon17 2015년 10월 20일
Hi, I've attached the matrices. I have a great deal of these to work through though. The future problems after this simple one I need to address are multiple dates in the rows of Mat1 and to calculate the amount of dates that occur in matrix two before and after each of these multiple dates... but that's after the basics are sorted.

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

답변 (1개)

Steven
Steven 2015년 10월 20일
Type in datevec in the console and hit the F1 key, matlab has an excellent help system. You may need to convert you date vectors to a different format with cell2mat.

카테고리

Help CenterFile Exchange에서 Time Series Objects에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by