Since when has it been possible to dot-index the output of a class method?
1 view (last 30 days)
Show older comments
Catalytic on 18 May 2022
Commented: Bruno Luong on 21 Jul 2022
Since when has it been possible to directly dot-index the output of a class method call, like this -
And why then, it is still not possible to do something similar with function calls -
Error: File: test.m Line: 1 Column: 1
Using the dot operator to index into the output of function 'subfunc' is not
Walter Roberson on 19 May 2022
Indexing: Use dot indexing into function calls
You can now use dot indexing to index into the result of a function call. MATLAB evaluates the function and then applies the dot indexing operation to the result.
For example, this function creates a structure:
function out = createStruct(in)
out = struct("aField", in);
You can call this function and immediately access the structure field it creates:
For more information, see Indexing into Function Call Results.
Bruno Luong on 21 Jul 2022
It does not do what you want but it runs without error
figure(gcf().Number).Name = 'hello'
More Answers (0)
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!