Filter löschen
Filter löschen

Could someone explain the absor code in matlab line by line ?

4 Ansichten (letzte 30 Tage)
farzad
farzad am 21 Mär. 2020
Kommentiert: Walter Roberson am 22 Mär. 2020
Hi All
I was reading the absor code in matlab, but it seems to be too complicated, even reading the relevant quaternions theory, seems to be too sophisticated. could someone help me to understand the code by explaining it kindly ?
  3 Kommentare
farzad
farzad am 21 Mär. 2020
Thank you dear Walter ! well I know about mathematics and physics. I think the complexity comes from the complexity of the theory and some functions in the code that I don't usually use.
just to start : what is the Input option processing and set up block doing exactly ?
these lines do not have an explanation
Walter Roberson
Walter Roberson am 22 Mär. 2020
That section of code is looping through any name/value pairs that are provided. It is looking for the option names doScale doTrans weights the purpose of which is explained in the comments:
%with parameter/value pair options,
%
% 'doScale' - Boolean flag. If TRUE, the global scale factor, s, is included.
% Otherwise, it is assumed that s=1. Default=FALSE.
%
% 'doTrans' - Boolean flag. If TRUE, the translation, t, is included. Otherwise,
% zero translation is assumed. Default=TRUE.
%
% 'weights' - The length N-vector of weights, w. Default, no weighting
It is using strcmp() against hard-coded strings because the code was designed before string() datatype was added to MATLAB, and strcmp() is the way to compare two character vectors. When it finds a character vector it recognizes, it takes the next parameter in the list as being the value to associate with the parameter, and the variables stored into are all hard-coded.
Standard option processing.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by