Publishing in matlab

Hello,
For a coursework I have to answer a question of two parts and publish them. The first part of the code is write a function, and the second one is run it for different values.
My problem is that I want to publish the two codes without running/executing them, and then I want to show that my function works by running it for ONLY 1 value (whereas in part 2 it runs it for lots of values that I do not want to display.
So basically, I want it to look like this:
%%Title
function ... end
%% Explanations
for values ... function... end
%% Example
run function for 1 value
the problems I've encountered so far is: - I can publish everything but not run my fct for 1 value - I can run it for one value but then it runs everything (including the function with unspecified values) - I can do it on 2 separate mfiles but not on 1.
Thank you very much, I hope I was clear!
thank you very much!

댓글 수: 1

Kaustubha Govind
Kaustubha Govind 2011년 2월 15일
From what I understand, if you suppress your function output by using a semicolon after the call, it shouldn't run it for you in the published file.

댓글을 달려면 로그인하십시오.

답변 (1개)

Oleg Komarov
Oleg Komarov 2011년 2월 15일

0 개 추천

You can go this way:
%%Title
type('myFunc.m')
%%Explanations
%%Example:
myFunc(1)
The point here is that you lose the M highlighting.
Another way would be to type directly the content of the function which will give you the error and then merge the two htmls editing them manually in order to keep the colors for the code.
Oleg

카테고리

도움말 센터File Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

질문:

2011년 2월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by