This code was working fine when I asked about it in Filter is too large but when I tried it again on another PC it gives me this error:
Warning: Direct access of structure fields returned by a function call (e.g., call to Untitled2) is not allowed. See MATLAB 7.10 Release Notes, "Subscripting Into Function Return Values" for details. ??? Attempt to reference field of non-structure array.
This forwarded me to help about "Subscripting Into Function Return Values", where if you have a function, such as the following, that returns a struct array:
function structOut = getStruct structOut = struct('fieldA', 5, 'fieldB', 10);
It is no longer valid to access fields of the structure by directly dot indexing the function's return value, as shown here:
Instead, you should first assign the returned structure to a variable, and then dot index the variable:
s = getStruct; s.fieldA ans = 5
But how can I apply it to multiply values?