필터 지우기
필터 지우기

algebra in degree minutes seconds

조회 수: 5 (최근 30일)
AbelM Kusemererwa
AbelM Kusemererwa 2015년 6월 19일
답변: Mukul Rao 2015년 6월 23일
The format of the variable 'a' are in degrees minutes but written as for example a= '4534.7899', where 45 is degrees and 34.7899 is minutes.
The vector cell 'c' is populated by data format such 'a' c= {a1; a2; a3}. 'c' is attached at lat How can I subtract a constant, angle 'a' from each cell in 'c' and obtain a column of cells 'd' which in seconds?
  댓글 수: 2
Mukul Rao
Mukul Rao 2015년 6월 22일
I do think I understand the format completely. How would this format represent say 45 degrees 34 minutes and 4.55 seconds?
AbelM Kusemererwa
AbelM Kusemererwa 2015년 6월 22일
he attached is a degree minutes vector cell in the format 5257.1172944 where deg=52 and min=57.1172944 a=5257.1172000 , 'a' is a single input angle of the same format as the attached file.
I want to subtract a from each cell in the vector cells attached and multiple the difference by 60 to obtain an answer in seconds

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

채택된 답변

Mukul Rao
Mukul Rao 2015년 6월 23일
You can make use of either the "arrayfun" or the "cellfun" to perform elementwise operations. Here are the links for these functions:
The commands would look like,
a = 5257.1172000;
load lat
%Convert entries in lat_cell to a number with "str2num"
output = cellfun(@(cellin) (str2num(cellin) - a)*60,lat_cell);
The variable "output" is a double array that contains the required differences.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by