Subtracting two matrices of date values
조회 수: 2 (최근 30일)
이전 댓글 표시
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
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.
답변 (1개)
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.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Dates and Time에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!