algebra in degree minutes seconds
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
AbelM Kusemererwa
le 19 Juin 2015
Réponse apportée : Mukul Rao
le 23 Juin 2015
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 commentaires
Mukul Rao
le 22 Juin 2015
I do think I understand the format completely. How would this format represent say 45 degrees 34 minutes and 4.55 seconds?
Réponse acceptée
Mukul Rao
le 23 Juin 2015
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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Type Identification dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!