📡 MATLAB Central - File Exchange - rating:5.0 | CATT2Matlab
More info in GitHub, clic on 'Learn more'.I'm developing the information, sorry, soon it will be more complete.Work in Windows and OSX. Screenshoots in GitHub.
More info in GitHub, clic on 'Learn more'.I'm developing the information, sorry, soon it will be more complete.Work in Windows and OSX. Screenshoots in GitHub.
JOSS:Macapype: An open multi-software framework for non-human primate brain anatomical MRI processing
Journal of Open Source Software
Macapype: An open multi-software framework for non-human primate brain anatomical MRI processing
Meunier et al., (2026). Macapype: An open multi-software framework for non-human primate brain anatomical MRI processing. Journal of Open Source Software, 11(125), 10203, https://doi.org/10.21105/joss.10203
📡 MATLAB Central - File Exchange - rating:4.5 | Deep Learning Tutorial Series
The code provides hands-on examples to implement convolutional neural networks (CNNs) for object recognition. The three demos have associated instructional videos that will allow for a complete tutorial experience to understand and implement deep learning techniques. The demos include:- Training a neural network from scratch- Using a pre-trained model (transfer learning)- Using a neural network as a feature extractor The use of a GPU and Parallel Computing Toolbox™ is recommended when running the examples. Demo 3 requires Statistics and Machine Learning Toolbox™ in addition to the required products below.
The code provides hands-on examples to implement convolutional neural networks (CNNs) for object recognition. The three demos have associated instructional videos that will allow for a complete tutorial experience to understand and implement deep learning techniques. The demos include:- Training a neural network from scratch- Using a pre-trained model (transfer learning)- Using a neural network as a feature extractor The use of a GPU and Parallel Computing Toolbox™ is recommended when running the examples. Demo 3 requires Statistics and Machine Learning Toolbox™ in addition to the required products below.
📡 MATLAB Central - File Exchange - rating:5.0 | dec2hex_ex
Matlab's dec2hex converts a vector of decimals into a charachter array - which is cumbersom to manipulatedec2hex_ex gives a solution for this...while... out = dec2hex([1 10 20]) out = 3×2 char array '01' '0A' '14' Syntax: [out,outCell] = dec2hex_ex(dec_vector,numDigits,addHexPrefix) Inputs: dec_vector: hold 1 or more decimals numDigits : optional, integer, can be given as empty braces ([]) addHexPrefix: optional, default = false, if true: adds '0x' so output could be sent to 'eval' function Outputs: out : The trivial output as char array outCell : Cell arrayoutput Examples: out = dec2hex_ex([1 10 20]) % out = '[1,A,14]' out = dec2hex_ex([1 10 20],3) % out = '[001, 00A, 014]' out = dec2hex_ex([1 10 20],[], 1) % out = '[0x1,0xA,0x14]' [out, outCell] = dec2hex_ex([1 10 20]) % outCell = {'1','A','14'} [out, outCell] = dec2hex_ex([1 10 20],[], 1) % outCell = {'0x1','0xA','0x14'} [out, outCell] = dec2hex_ex([1 10 20],4 , 1) % out = '[0x0001, 0x000A, 0x0014]'
Matlab's dec2hex converts a vector of decimals into a charachter array - which is cumbersom to manipulatedec2hex_ex gives a solution for this...while... out = dec2hex([1 10 20]) out = 3×2 char array '01' '0A' '14' Syntax: [out,outCell] = dec2hex_ex(dec_vector,numDigits,addHexPrefix) Inputs: dec_vector: hold 1 or more decimals numDigits : optional, integer, can be given as empty braces ([]) addHexPrefix: optional, default = false, if true: adds '0x' so output could be sent to 'eval' function Outputs: out : The trivial output as char array outCell : Cell arrayoutput Examples: out = dec2hex_ex([1 10 20]) % out = '[1,A,14]' out = dec2hex_ex([1 10 20],3) % out = '[001, 00A, 014]' out = dec2hex_ex([1 10 20],[], 1) % out = '[0x1,0xA,0x14]' [out, outCell] = dec2hex_ex([1 10 20]) % outCell = {'1','A','14'} [out, outCell] = dec2hex_ex([1 10 20],[], 1) % outCell = {'0x1','0xA','0x14'} [out, outCell] = dec2hex_ex([1 10 20],4 , 1) % out = '[0x0001, 0x000A, 0x0014]'
📡 MATLAB Central - File Exchange - rating:5.0 | Systems-Level Microgrid Simulation from One-Line Diagram
Simscape Power Systems can be used to schematically represent a one-line microgrid diagram using blocks that represent different distributed energy resources (DERs). The DERs in this example include renewables, such as solar, a diesel GenSet, and an energy storage system (ESS). Using the simple microgrid, you see how desktop simulation can be used to subject the distribution system with residential load changes or unintentional islanding of the microgrid. The included slides detail other common workflows for systems-level microgrid simulation. Using Simulink Real-time, this simple microgrid can quickly be migrated to a real-time machine for hardware-in-the-loop testing.
Simscape Power Systems can be used to schematically represent a one-line microgrid diagram using blocks that represent different distributed energy resources (DERs). The DERs in this example include renewables, such as solar, a diesel GenSet, and an energy storage system (ESS). Using the simple microgrid, you see how desktop simulation can be used to subject the distribution system with residential load changes or unintentional islanding of the microgrid. The included slides detail other common workflows for systems-level microgrid simulation. Using Simulink Real-time, this simple microgrid can quickly be migrated to a real-time machine for hardware-in-the-loop testing.
📡 MATLAB Central - File Exchange - rating:5.0 | Natural-Order Row Sort
SummaryNatural order sort the rows of a string/cell/categorical/table array. Sorts the text by character code taking into account the values of any number substrings. Compare for example:>> X = {'x2','10';'x10','0';'x1','0';'x2','2'};>> sortrows(X) % Wrong numeric orderans = 'x1' '0' 'x10' '0' 'x2' '10' 'x2' '2'>> natsortrows(X) % Correct numeric orderans = 'x1' '0' 'x2' '2' 'x2' '10' 'x10' '0'By default NATSORTROWS interprets all consecutive digits as integer numbers, the number substring recognition can be specified using a regular expression: see NATSORT for details.File DependencyThe natural-order sort is provided by the function NATSORT (File Exchange 34464). All of NATSORT's optional inputs are supported by NATSORTROWS.Examples>> A = {'B','2','X';'A','100','X';'B','10','X';'A','2','Y';'A','20','X'};>> sortrows(A) % SORTROWS for comparison.ans = 'A' '100' 'X' 'A' '2' 'Y' 'A' '20' 'X' 'B' '10' 'X' 'B' '2' 'X'>> natsortrows(A)ans = 'A' '2' 'Y' 'A' '20' 'X' 'A' '100' 'X' 'B' '2' 'X' 'B' '10' 'X'>> natsortrows(A,[],'descend')ans = 'B' '10' 'X' 'B' '2' 'X' 'A' '100' 'X' 'A' '20' 'X' 'A' '2' 'Y'>> sortrows(A,[2,-3]) % SORTROWS for comparison.ans = 'B' '10' 'X' 'A' '100' 'X' 'A' '2' 'Y' 'B' '2' 'X' 'A' '20' 'X'>> natsortrows(A,[],[2,-3])ans = 'A' '2' 'Y' 'B' '2' 'X' 'B' '10' 'X' 'A' '20' 'X' 'A' '100' 'X'>> natsortrows(A,[],[false,true,true],{'ascend','descend'})ans = 'A' '2' 'Y' 'B' '2' 'X' 'B' '10' 'X' 'A' '20' 'X' 'A' '100' 'X'>> natsortrows(A,[],{'ignore','ascend','descend'})ans = 'A' '2' 'Y' 'B' '2' 'X' 'B' '10' 'X' 'A' '20' 'X' 'A' '100' 'X'T = cell2table(A);natsortrows(T,[], [2,-3]) % TABLEans = A1 A2 A3 ___ _____ ___ 'A' '2' 'Y' 'B' '2' 'X' 'B' '10' 'X' 'A' '20' 'X' 'A' '100' 'X'natsortrows(T,[], {'A2','A3'},{'ascend','descend'}) % TABLEans = A1 A2 A3 ___ _____ ___ 'A' '2' 'Y' 'B' '2' 'X' 'B' '10' 'X' 'A' '20' 'X' 'A' '100' 'X'>> B = {'ABCD';'3e45';'67.8';'+Inf';'-12';'+9';'NaN'};>> sortrows(B) % SORTROWS for comparison.ans = '+9' '+Inf' '-12' '3e45' '67.8' 'ABCD' 'NaN'>> natsortrows(B,'[-+]?(NaN|Inf|\d+\.?\d*(E[-+]?\d+)?)')ans = '-12' '+9' '67.8' '3e45' '+Inf' 'NaN' 'ABCD'>> C = {'A2', 2; 'A10', 1; 'A2', 1}; % Scalar numerics in a column:>> natsortrows(C,[],'sortnum')ans = 'A2' [1] 'A2' [2] 'A10' [1]>> natsortrows(C,[],'sortnum',{'ascend','descend'})ans = 'A2' [2] 'A2' [1] 'A10' [1]See AlsoTo sort text into the order of arbitrary/custom text sequences (e.g. alphabets) use ARBSORT:https://www.mathworks.com/matlabcentral/fileexchange/132263-custom-list-arbitrary-sequence-sortTo sort the elements of a string/cell array use NATSORT: http://www.mathworks.com/matlabcentral/fileexchange/34464-customizable-natural-order-sortTo sort file-names or folder-names use NATSORTFILES: http://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sortGitHub collection of all of these functions:https://github.com/DrosteEffect/NaturalSortOrder
SummaryNatural order sort the rows of a string/cell/categorical/table array. Sorts the text by character code taking into account the values of any number substrings. Compare for example:>> X = {'x2','10';'x10','0';'x1','0';'x2','2'};>> sortrows(X) % Wrong numeric orderans = 'x1' '0' 'x10' '0' 'x2' '10' 'x2' '2'>> natsortrows(X) % Correct numeric orderans = 'x1' '0' 'x2' '2' 'x2' '10' 'x10' '0'By default NATSORTROWS interprets all consecutive digits as integer numbers, the number substring recognition can be specified using a regular expression: see NATSORT for details.File DependencyThe natural-order sort is provided by the function NATSORT (File Exchange 34464). All of NATSORT's optional inputs are supported by NATSORTROWS.Examples>> A = {'B','2','X';'A','100','X';'B','10','X';'A','2','Y';'A','20','X'};>> sortrows(A) % SORTROWS for comparison.ans = 'A' '100' 'X' 'A' '2' 'Y' 'A' '20' 'X' 'B' '10' 'X' 'B' '2' 'X'>> natsortrows(A)ans = 'A' '2' 'Y' 'A' '20' 'X' 'A' '100' 'X' 'B' '2' 'X' 'B' '10' 'X'>> natsortrows(A,[],'descend')ans = 'B' '10' 'X' 'B' '2' 'X' 'A' '100' 'X' 'A' '20' 'X' 'A' '2' 'Y'>> sortrows(A,[2,-3]) % SORTROWS for comparison.ans = 'B' '10' 'X' 'A' '100' 'X' 'A' '2' 'Y' 'B' '2' 'X' 'A' '20' 'X'>> natsortrows(A,[],[2,-3])ans = 'A' '2' 'Y' 'B' '2' 'X' 'B' '10' 'X' 'A' '20' 'X' 'A' '100' 'X'>> natsortrows(A,[],[false,true,true],{'ascend','descend'})ans = 'A' '2' 'Y' 'B' '2' 'X' 'B' '10' 'X' 'A' '20' 'X' 'A' '100' 'X'>> natsortrows(A,[],{'ignore','ascend','descend'})ans = 'A' '2' 'Y' 'B' '2' 'X' 'B' '10' 'X' 'A' '20' 'X' 'A' '100' 'X'T = cell2table(A);natsortrows(T,[], [2,-3]) % TABLEans = A1 A2 A3 ___ _____ ___ 'A' '2' 'Y' 'B' '2' 'X' 'B' '10' 'X' 'A' '20' 'X' 'A' '100' 'X'natsortrows(T,[], {'A2','A3'},{'ascend','descend'}) % TABLEans = A1 A2 A3 ___ _____ ___ 'A' '2' 'Y' 'B' '2' 'X' 'B' '10' 'X' 'A' '20' 'X' 'A' '100' 'X'>> B = {'ABCD';'3e45';'67.8';'+Inf';'-12';'+9';'NaN'};>> sortrows(B) % SORTROWS for comparison.ans = '+9' '+Inf' '-12' '3e45' '67.8' 'ABCD' 'NaN'>> natsortrows(B,'[-+]?(NaN|Inf|\d+\.?\d*(E[-+]?\d+)?)')ans = '-12' '+9' '67.8' '3e45' '+Inf' 'NaN' 'ABCD'>> C = {'A2', 2; 'A10', 1; 'A2', 1}; % Scalar numerics in a column:>> natsortrows(C,[],'sortnum')ans = 'A2' [1] 'A2' [2] 'A10' [1]>> natsortrows(C,[],'sortnum',{'ascend','descend'})ans = 'A2' [2] 'A2' [1] 'A10' [1]See AlsoTo sort text into the order of arbitrary/custom text sequences (e.g. alphabets) use ARBSORT:https://www.mathworks.com/matlabcentral/fileexchange/132263-custom-list-arbitrary-sequence-sortTo sort the elements of a string/cell array use NATSORT: http://www.mathworks.com/matlabcentral/fileexchange/34464-customizable-natural-order-sortTo sort file-names or folder-names use NATSORTFILES: http://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sortGitHub collection of all of these functions:https://github.com/DrosteEffect/NaturalSortOrder
📡 MATLAB Central - File Exchange - rating:5.0 | Natural-Order Filename Sort
SummaryNatural order sort the text in a string/cell/structure array. Sorts the text by character code taking into account the values of any number substrings. Compare for example:>> A = {'a2.txt', 'a10.txt', 'a1.txt'};>> sort(A)ans = 'a1.txt' 'a10.txt' 'a2.txt'>> natsortfiles(A)ans = 'a1.txt' 'a2.txt' 'a10.txt'By default NATSORTFILES interprets all consecutive digits as integer numbers, the number substring recognition can be specified using a regular expression: see NATSORT for details.NATSORTFILES does not perform a naive natural-order sort, but sorts the filenames and file extensions separately to ensure a dictionary sort, where shorter filenames always sort before longer ones. Likewise filepaths are split at each file-separator character, and each level of the file hierarchy is sorted separately.Example with DIR()P = 'C:\SomeDir\SubDir';S = dir(fullfile(P,'*.txt'));S = natsortfiles(S);for k = 1:numel(S) F = fullfile(P,S(k).name)endFile DependencyThe natural-order sort is provided by the function NATSORT (File Exchange 34464). All of NATSORT's optional inputs are supported by NATSORTFILES.Examples>> A = {'a2.txt', 'a10.txt', 'a1.txt'}>> sort(A)ans = 'a1.txt' 'a10.txt' 'a2.txt'>> natsortfiles(A)ans = 'a1.txt' 'a2.txt' 'a10.txt'>> B = {'test2.m'; 'test10-old.m'; 'test.m'; 'test10.m'; 'test1.m'};>> sort(B) % Wrong number order:ans = 'test.m' 'test1.m' 'test10-old.m' 'test10.m' 'test2.m'>> natsortfiles(B) % Shorter names before longer:ans = 'test.m' 'test1.m' 'test2.m' 'test10.m' 'test10-old.m'%% Directory Names:>> C = {'A2-old\test.m';'A10\test.m';'A2\test.m';'A1\test.m';'A1-archive.zip'};>> sort(C) % Wrong number order, and '-' sorts before '\':ans = 'A1-archive.zip' 'A10\test.m' 'A1\test.m' 'A2-old\test.m' 'A2\test.m'>> natsortfiles(C) % Shorter names before longer:ans = 'A1\test.m' 'A1-archive.zip' 'A2\test.m' 'A2-old\test.m' 'A10\test.m'>> D = {'A1\B', 'A+/B', 'A/B1', 'A=/B', 'A\B0'};>> sort(D)ans = 'A+/B' 'A/B1' 'A1\B' 'A=/B' 'A\B0'>> natsortfiles(D)ans = 'A\B0' 'A/B1' 'A1\B' 'A+/B' 'A=/B'>> F = {'test_new.m'; 'test-old.m'; 'test.m'};>> sort(F) % Note '-' sorts before '.':ans = 'test-old.m' 'test.m' 'test_new.m'>> natsortfiles(F) % Shorter names before longer:ans = 'test.m' 'test-old.m' 'test_new.m'See AlsoTo sort text into the order of arbitrary/custom text sequences (e.g. alphabets) use ARBSORT:https://www.mathworks.com/matlabcentral/fileexchange/132263-custom-list-arbitrary-sequence-sortTo sort the elements of a string/cell array use NATSORT: http://www.mathworks.com/matlabcentral/fileexchange/34464-customizable-natural-order-sortTo sort the rows of a string/cell array use NATSORTROWS: http://www.mathworks.com/matlabcentral/fileexchange/47433-natural-order-row-sortGitHub collection of all of these functions:https://github.com/DrosteEffect/NaturalSortOrder
SummaryNatural order sort the text in a string/cell/structure array. Sorts the text by character code taking into account the values of any number substrings. Compare for example:>> A = {'a2.txt', 'a10.txt', 'a1.txt'};>> sort(A)ans = 'a1.txt' 'a10.txt' 'a2.txt'>> natsortfiles(A)ans = 'a1.txt' 'a2.txt' 'a10.txt'By default NATSORTFILES interprets all consecutive digits as integer numbers, the number substring recognition can be specified using a regular expression: see NATSORT for details.NATSORTFILES does not perform a naive natural-order sort, but sorts the filenames and file extensions separately to ensure a dictionary sort, where shorter filenames always sort before longer ones. Likewise filepaths are split at each file-separator character, and each level of the file hierarchy is sorted separately.Example with DIR()P = 'C:\SomeDir\SubDir';S = dir(fullfile(P,'*.txt'));S = natsortfiles(S);for k = 1:numel(S) F = fullfile(P,S(k).name)endFile DependencyThe natural-order sort is provided by the function NATSORT (File Exchange 34464). All of NATSORT's optional inputs are supported by NATSORTFILES.Examples>> A = {'a2.txt', 'a10.txt', 'a1.txt'}>> sort(A)ans = 'a1.txt' 'a10.txt' 'a2.txt'>> natsortfiles(A)ans = 'a1.txt' 'a2.txt' 'a10.txt'>> B = {'test2.m'; 'test10-old.m'; 'test.m'; 'test10.m'; 'test1.m'};>> sort(B) % Wrong number order:ans = 'test.m' 'test1.m' 'test10-old.m' 'test10.m' 'test2.m'>> natsortfiles(B) % Shorter names before longer:ans = 'test.m' 'test1.m' 'test2.m' 'test10.m' 'test10-old.m'%% Directory Names:>> C = {'A2-old\test.m';'A10\test.m';'A2\test.m';'A1\test.m';'A1-archive.zip'};>> sort(C) % Wrong number order, and '-' sorts before '\':ans = 'A1-archive.zip' 'A10\test.m' 'A1\test.m' 'A2-old\test.m' 'A2\test.m'>> natsortfiles(C) % Shorter names before longer:ans = 'A1\test.m' 'A1-archive.zip' 'A2\test.m' 'A2-old\test.m' 'A10\test.m'>> D = {'A1\B', 'A+/B', 'A/B1', 'A=/B', 'A\B0'};>> sort(D)ans = 'A+/B' 'A/B1' 'A1\B' 'A=/B' 'A\B0'>> natsortfiles(D)ans = 'A\B0' 'A/B1' 'A1\B' 'A+/B' 'A=/B'>> F = {'test_new.m'; 'test-old.m'; 'test.m'};>> sort(F) % Note '-' sorts before '.':ans = 'test-old.m' 'test.m' 'test_new.m'>> natsortfiles(F) % Shorter names before longer:ans = 'test.m' 'test-old.m' 'test_new.m'See AlsoTo sort text into the order of arbitrary/custom text sequences (e.g. alphabets) use ARBSORT:https://www.mathworks.com/matlabcentral/fileexchange/132263-custom-list-arbitrary-sequence-sortTo sort the elements of a string/cell array use NATSORT: http://www.mathworks.com/matlabcentral/fileexchange/34464-customizable-natural-order-sortTo sort the rows of a string/cell array use NATSORTROWS: http://www.mathworks.com/matlabcentral/fileexchange/47433-natural-order-row-sortGitHub collection of all of these functions:https://github.com/DrosteEffect/NaturalSortOrder
📡 MATLAB Central - File Exchange - rating:5.0 | Customizable Natural-Order Sort
SummaryNatural order sort the text in a string/cell/categorical array. Sorts the text by character code taking into account the values of any number substrings. Compare for example:X = {'a2', 'a10', 'a1'}; sort(X) ans = 'a1' 'a10' 'a2' natsort(X) ans = 'a1' 'a2' 'a10'By default NATSORT interprets all consecutive digits as integer numbers, the number substring recognition can be specified using a regular expression, allowing the number substrings to have: a +/- sign a decimal point and decimal fraction E-notation exponentdecimal, octal, hexadecimal or binary notation Inf or NaN values criteria supported by regular expressions: lookarounds, quantifiers, etc.And of course the sorting itself can also be controlled: ascending/descending sort directioncharacter case sensitivity/insensitivityrelative order of numbers vs. charactersrelative order of numbers vs NaNsExamples%% Multiple integers (e.g. release version numbers):>> A = {'v10.6', 'v9.10', 'v9.5', 'v10.10', 'v9.10.20', 'v9.10.8'};>> sort(A) % for comparison.ans = 'v10.10' 'v10.6' 'v9.10' 'v9.10.20' 'v9.10.8' 'v9.5'>> natsort(A)ans = 'v9.5' 'v9.10' 'v9.10.8' 'v9.10.20' 'v10.6' 'v10.10'%% Integer, decimal, NaN, or Inf numbers, possibly with +/- signs:>> B = {'test+NaN', 'test11.5', 'test-1.4', 'test', 'test-Inf', 'test+0.3'};>> sort(B) % for comparison.ans = 'test' 'test+0.3' 'test+NaN' 'test-1.4' 'test-Inf' 'test11.5'>> natsort(B, '[-+]?(NaN|Inf|\d+\.?\d*)')ans = 'test' 'test-Inf' 'test-1.4' 'test+0.3' 'test11.5' 'test+NaN'%% Integer or decimal numbers, possibly with an exponent:>> C = {'0.56e007', '', '43E-2', '10000', '9.8'};>> sort(C) % for comparison.ans = '' '0.56e007' '10000' '43E-2' '9.8'>> natsort(C, '\d+\.?\d*(E[-+]?\d+)?')ans = '' '43E-2' '9.8' '10000' '0.56e007'%% Hexadecimal numbers (with '0X' prefix):>> D = {'a0X7C4z', 'a0X5z', 'a0X18z', 'a0XFz'};>> sort(D) % for comparison.ans = 'a0X18z' 'a0X5z' 'a0X7C4z' 'a0XFz'>> natsort(D, '0X[0-9A-F]+', '%i')ans = 'a0X5z' 'a0XFz' 'a0X18z' 'a0X7C4z'%% Binary numbers:>> E = {'a11111000100z', 'a101z', 'a000000000011000z', 'a1111z'};>> sort(E) % for comparison.ans = 'a000000000011000z' 'a101z' 'a11111000100z' 'a1111z'>> natsort(E, '[01]+', '%b')ans = 'a101z' 'a1111z' 'a000000000011000z' 'a11111000100z'%% Case sensitivity:>> F = {'a2', 'A20', 'A1', 'a10', 'A2', 'a1'};>> natsort(F, [], 'ignorecase') % defaultans = 'A1' 'a1' 'a2' 'A2' 'a10' 'A20'>> natsort(F, [], 'matchcase')ans = 'A1' 'A2' 'A20' 'a1' 'a2' 'a10'%% Sort order:>> G = {'2', 'a', '', '3', 'B', '1'};>> natsort(G, [], 'ascend') % defaultans = '' '1' '2' '3' 'a' 'B'>> natsort(G, [], 'descend')ans = 'B' 'a' '3' '2' '1' ''>> natsort(G, [], 'num> natsort(G, [], 'char> natsort({'a18446744073709551615z', 'a18446744073709551614z'}, [], '%lu')ans = 'a18446744073709551614z' 'a18446744073709551615z'See AlsoTo sort text into the order of arbitrary/custom text sequences (e.g. alphabets) use ARBSORT:https://www.mathworks.com/matlabcentral/fileexchange/132263-custom-list-arbitrary-sequence-sortTo sort file-names or folder-names use NATSORTFILES:http://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sortTo sort the rows of a string/cell array use NATSORTROWS:http://www.mathworks.com/matlabcentral/fileexchange/47433-natural-order-row-sortGitHub collection of all of these functions:https://github.com/DrosteEffect/NaturalSortOrder
SummaryNatural order sort the text in a string/cell/categorical array. Sorts the text by character code taking into account the values of any number substrings. Compare for example:X = {'a2', 'a10', 'a1'}; sort(X) ans = 'a1' 'a10' 'a2' natsort(X) ans = 'a1' 'a2' 'a10'By default NATSORT interprets all consecutive digits as integer numbers, the number substring recognition can be specified using a regular expression, allowing the number substrings to have: a +/- sign a decimal point and decimal fraction E-notation exponentdecimal, octal, hexadecimal or binary notation Inf or NaN values criteria supported by regular expressions: lookarounds, quantifiers, etc.And of course the sorting itself can also be controlled: ascending/descending sort directioncharacter case sensitivity/insensitivityrelative order of numbers vs. charactersrelative order of numbers vs NaNsExamples%% Multiple integers (e.g. release version numbers):>> A = {'v10.6', 'v9.10', 'v9.5', 'v10.10', 'v9.10.20', 'v9.10.8'};>> sort(A) % for comparison.ans = 'v10.10' 'v10.6' 'v9.10' 'v9.10.20' 'v9.10.8' 'v9.5'>> natsort(A)ans = 'v9.5' 'v9.10' 'v9.10.8' 'v9.10.20' 'v10.6' 'v10.10'%% Integer, decimal, NaN, or Inf numbers, possibly with +/- signs:>> B = {'test+NaN', 'test11.5', 'test-1.4', 'test', 'test-Inf', 'test+0.3'};>> sort(B) % for comparison.ans = 'test' 'test+0.3' 'test+NaN' 'test-1.4' 'test-Inf' 'test11.5'>> natsort(B, '[-+]?(NaN|Inf|\d+\.?\d*)')ans = 'test' 'test-Inf' 'test-1.4' 'test+0.3' 'test11.5' 'test+NaN'%% Integer or decimal numbers, possibly with an exponent:>> C = {'0.56e007', '', '43E-2', '10000', '9.8'};>> sort(C) % for comparison.ans = '' '0.56e007' '10000' '43E-2' '9.8'>> natsort(C, '\d+\.?\d*(E[-+]?\d+)?')ans = '' '43E-2' '9.8' '10000' '0.56e007'%% Hexadecimal numbers (with '0X' prefix):>> D = {'a0X7C4z', 'a0X5z', 'a0X18z', 'a0XFz'};>> sort(D) % for comparison.ans = 'a0X18z' 'a0X5z' 'a0X7C4z' 'a0XFz'>> natsort(D, '0X[0-9A-F]+', '%i')ans = 'a0X5z' 'a0XFz' 'a0X18z' 'a0X7C4z'%% Binary numbers:>> E = {'a11111000100z', 'a101z', 'a000000000011000z', 'a1111z'};>> sort(E) % for comparison.ans = 'a000000000011000z' 'a101z' 'a11111000100z' 'a1111z'>> natsort(E, '[01]+', '%b')ans = 'a101z' 'a1111z' 'a000000000011000z' 'a11111000100z'%% Case sensitivity:>> F = {'a2', 'A20', 'A1', 'a10', 'A2', 'a1'};>> natsort(F, [], 'ignorecase') % defaultans = 'A1' 'a1' 'a2' 'A2' 'a10' 'A20'>> natsort(F, [], 'matchcase')ans = 'A1' 'A2' 'A20' 'a1' 'a2' 'a10'%% Sort order:>> G = {'2', 'a', '', '3', 'B', '1'};>> natsort(G, [], 'ascend') % defaultans = '' '1' '2' '3' 'a' 'B'>> natsort(G, [], 'descend')ans = 'B' 'a' '3' '2' '1' ''>> natsort(G, [], 'num> natsort(G, [], 'char> natsort({'a18446744073709551615z', 'a18446744073709551614z'}, [], '%lu')ans = 'a18446744073709551614z' 'a18446744073709551615z'See AlsoTo sort text into the order of arbitrary/custom text sequences (e.g. alphabets) use ARBSORT:https://www.mathworks.com/matlabcentral/fileexchange/132263-custom-list-arbitrary-sequence-sortTo sort file-names or folder-names use NATSORTFILES:http://www.mathworks.com/matlabcentral/fileexchange/47434-natural-order-filename-sortTo sort the rows of a string/cell array use NATSORTROWS:http://www.mathworks.com/matlabcentral/fileexchange/47433-natural-order-row-sortGitHub collection of all of these functions:https://github.com/DrosteEffect/NaturalSortOrder
TDRSOD estimates the epoch state and surface-force coefficients of a low-Earth user satellite together with one or more Tracking and Data Relay Satellite (TDRS) vehicles from four-way range measurements. The packaged demonstration processes UARS plus TDRS-4 and TDRS-5 on 1 September 1999 using White Sands stations 161 and 162.The dynamical model, coordinate transformations, and variational-equation formulation follow Montenbruck and Gill, Satellite Orbits: Models, Methods and Applications (Springer, 2005). Time, polar motion, and nutation follow IERS Conventions; planetary positions come from JPL DE440; Earth orientation and space weather files are the CelesTrak EOP-All and SW-All products.Version 3.3.0 keeps the 3.2.2 estimation architecture (batch Gauss–Newton, four-way range, eight parameters per satellite) and updates the force model, gravity gradient, and iteration control. A typical run of the packaged case reduces the four-way range residuals to a mean of 0.02 m and an RMS of 1.91 m after four iterations.References:Montenbruck O., Gill E., Satellite Orbits: Models, Methods, and Applications, Springer, Heidelberg, corrected 3rd printing, 2005.Vallado D. A., Fundamentals of Astrodynamics and Applications, 4th ed., 2013.Petit G., Luzum B. (eds.), IERS Conventions (2010), IERS Technical Note No. 36.Knocke P. C., Ries J. C., Tapley B. D., Earth Radiation Pressure Effects on Satellites, AIAA/AAS Astrodynamics Conference, Minneapolis, 1988.Picone J. M. et al., NRLMSISE-00 empirical atmosphere, J. Geophys. Res., 2002.Tapley B. et al., GGM03C/GGM03S gravity models, CSR.JPL Planetary and Lunar Ephemerides DE440, https://ssd.jpl.nasa.gov/planets/eph_export.html CelesTrak Earth orientation: https://celestrak.org/SpaceData/EOP-All.txt CelesTrak space weather: https://celestrak.org/SpaceData/SW-All.txt IERS FES2004 ocean-tide coefficients, Conventions (2010) Chapter 6.
Please open Telegram to view this post
VIEW IN TELEGRAM
How to Use Terminal to Bring AI Coding Agents into MATLAB and Simulink
#YouTube
via MATLAB@YouTube (author: MATLAB)
#YouTube
via MATLAB@YouTube (author: MATLAB)
YouTube
How to Use Terminal to Bring AI Coding Agents into MATLAB and Simulink
Terminal brings an embedded system terminal into the MATLAB® desktop or Simulink® canvas. Use it to run system commands, Git workflows, Docker workflows, and command-line AI coding agents without leaving your engineering environment. Work in a complete terminal…
(More information is available at http://www.libprima.net ; in case of questions or requests, open an issue at the GitHub repository of PRIMA)PRIMA is a package for solving general nonlinear optimization problems without requiring derivatives. It is the successor of PDFO.PRIMA provides a MATLAB functions prima, which can automatically identify the type of your problem and then solve it by one of Powell's methods, namely COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA.The prima function is designed to be compatible with the fmincon function available in the Optimization Toolbox of MATLAB. You can call prima in the same way as calling fmincon:x = prima(fun, x0)x = prima(fun, x0, A, b)x = prima(fun, x0, A, b, Aeq, beq)x = prima(fun, x0, A, b, Aeq, beq, lb, ub)x = prima(fun, x0, A, b, Aeq, beq, lb, ub, nonlcon)x = prima(fun, x0, A, b, Aeq, beq, lb, ub, nonlcon, options)x = prima(problem) % PROBLEM is a structure defining the optimization problem[x, fval] = prima(___)[x, fval, exitflag, output] = prima(___)In addition, prima can be called in some flexible ways that are not supported by fmincon. If your problem can be solved by fmincon without specifying the derivatives, then it can probably be better solved by prima; if your problem cannot be solved by fmincon, then try prima.For the installation of PRIMA, see https://github.com/libprima/prima/blob/main/README_mat.md .If you need help with the setup of MEX, see https://www.mathworks.com/matlabcentral/fileexchange/127968-setup_mex .The "P" in the name stands for Powell, and "RIMA" is an acronym for "Reference Implementation with Modernization and Amelioration".PRIMA is dedicated to the late Professor M. J. D. Powell FRS (1936--2015).
Please open Telegram to view this post
VIEW IN TELEGRAM
2nd edition of Geomorphometry – Concepts, Software, Applications out now
via TopoToolbox (author: wschwanghart)
via TopoToolbox (author: wschwanghart)
TopoToolbox
2nd edition of Geomorphometry – Concepts, Software, Applications out now
The blue bible has been my faithful companion for all sorts of questions about concepts, algorithms and software in geomorphometry. With its release in 2009, it has been somewhat outdated, given th…