How can I create a custom excel function using matlab ?
2 ビュー (過去 30 日間)
古いコメントを表示
Madam/Sir,
I want to use the fuction needed only in excel platform.
Let it be considered that few cells of two or more sheets will be taken as input argument of a function. And the output will be returned in another cell.
for example
'B7' cell of sheet1, 'C8' cell of sheet2 , 'D9' cell of sheet3 will be taken as input argument of a custom function named 'mywork_function'. The output of 'mywork_function' output will release its output in 'B8' cell of sheet1.
This function named 'mywork_function' should have been written in matlab environment.
Please help.
If possible please release a video explaining this problem to my mail id sarada@iiit-bh.ac.in
回答 (1 件)
Uday Pradhan
2020 年 10 月 14 日
Hi Sarada,
You can use Spreadsheet Link to call MATLAB functions from Microsoft Excel. Firstly, check if Spreadsheet Link is installed by running
>> license ('test','excel_link')
on your MATLAB command line. If the answer is 1, then follow the following steps else check the previous link for installation guidance.
- Open Microsoft Excel and go to “Add – ins”. If you don’t have “Spreadsheet link” in the available Add – ins section. Click on Browse.
2. In the Browse window, navigate to the Spreadsheet link add – in (this is generally available at matlabroot/toolbox/exlink). Choose the add – in file “excllink”.

3. Now you can call MATLAB functions from Excel. Right Click on any empty cell on your worksheet and navigate to MATLAB > MATLAB function wizard.
You can now refer to this documentation page : Find Custom MATLAB function from MATLAB function wizard in Excel to see how can we access custom functions from Excel and then for steps to execute that function please see this link. While entering input arguments to the custom function you must use the format: Sheet1!$B$6 which indicates the cell B6 in sheet 1. Similarly, use the "Optional Output Cell(s)" section in the Function arguments window to display the result in a specified cell of any sheet

Hope this helps!
1 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Import from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!