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

1 vue (au cours des 30 derniers jours)
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

Réponse acceptée

YT
YT le 18 Oct 2018
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);

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by