How do I call this function into my main code and assign an output to it ?

1 次查看(过去 30 天)
Please can anyone clarify me on this. I have a function file named “decompose_kernel” and I have another .m file containing my codes with coefficients/outputs (CA, CH, CV, CD). These outputs are approximation and detail coefficients I extracted from my input image. I do wish to apply separable filter algorithm contained in the function file named “decompose_kernel” on these coefficients (CA,CH,CV,CD).
How do I call this function “decompose_kernel" into my main code and assign an output to it ?
I will appreciate your suggestions. Thanks

采纳的回答

YT
YT 2018-10-18
If I got this correct, you got 2 files:
%mainfile.m
... some code and variables CA, CH, CV, CD
and
%decompose_kernel.m
function [outputarguments] = decompose_kernel(inputarguments)
... some code
end
If this is correct, I assume you never really worked with functions much before and should read up on how to use them ( https://mathworks.com/help/matlab/ref/function.html ).
So if you want to use the function decompose_kernel in your main file and use the variables CA/CH/CV/CD, you can do it like this:
%mainfile.m
... some code and variables CA, CH, CV, CD
[output] = decompose_kernel(CA, CH, CV, CD);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by