필터 지우기
필터 지우기

Unable to publish matlab .m file in cell mode, to Micosoft Word 2010

조회 수: 1 (최근 30일)
When I try to publish a .m file in cell mode, using the publish button at the top of the editor, I get the following error message in the command window:
??? Error using ==> saveas at 72 Invalid Simulink object specifier
Error in ==> mxdom2word at 149 doc.SaveAs(outputPath,wdFormatDocument);
Error in ==> publish at 183 mxdom2word(dom,outputAbsoluteFilename);
Error in ==> mdbpublish at 55 outputPath = publish(file, options);
??? Error using ==> open at 69 NAME must contain a single string.
I don't really understand the error message. Please note that I changed the default publish output option from "html" to "doc" (Also: The below cell mode code publishes just fine to html).
I would very much appreciate any assistance. My goal is to publish the below file in Microsoft Word 2010. Note: I CAN publish to a .ppt file format using Microsoft Powerpoint 2010. Finally, I discovered that I cannot publish to .pdf file format. I am using Matlab 2011a.
Please advise!
Thank you in advance.
Complete code follows:
%%PROGRAM Integrate_and_Fire_Neuron.m
%
% DATE OF LAST MODIFICATION: 30 May 2011
%
%%PURPOSE
%
% This program demonstrates the basic Integrate-and-Fire
% model of neuronal activity.
% (Ref: http://en.wikipedia.org/wiki/Biological_neuron_model)
%
% In this model, current is applied continuously to a neuron.
% The neuron "adds up" (integrates) the applied current over
% time, which produces an ever-rising internal voltage.
% When the neuron's internal voltage exceeds a particular
% threshhold, the neuron "fires" by discharging its
% internal voltage down the axon. The neuron's internal
% voltage then drops back to the "rest voltage"
% level, and current integration begins again.
% The simulation demonstrates a well-defined
% cyclic pattern called "spiking". Several choices
% are available to model the effect of different
% applied currents on a neuron's firing behavior.
% This simulation uses abstract parameters
% (that is, no units are attached to the global
% model input parameters, or to the timesteps),
% but can certainly accommodate actual experimental
% or literature values as required.
clear;clc
%%User-Defined Inputs (Global Model Parameters)
total_time_units = 50; %simulation length
resting_voltage = 0.5; %neuron's rest voltage
threshhold_voltage = 3.0; %neuron's threshhold voltage
capacitance = 3.0; %neuron's capacitance
%%User-Defined Input (Neuron Current Model)
current_model_choice = 1; %select model to use
%%Calculating the Neuron Model Parameters
if current_model_choice == 1
current_flow_in = @(t)( 0.5 );
modelstr = 'Constant Current';
elseif current_model_choice == 2
current_flow_in = @(t)( abs(1.0*sin(t/pi)) );
modelstr = 'Sinusoidal Current';
else
current_flow_in = @(t)( 0.5 );
modelstr = 'Constant Current';
end
%%Initializing the Input Parameters
time(total_time_units) = 0.0; %pre-allocate time array
time(1) = 0; %set initial time
voltage(total_time_units) = 0.0; %pre-allocate voltage array
voltage(1)= resting_voltage; %set initial voltage
deltat = 1.0; %deltat = 1.0 time unit
%%Computing Neuron Voltage vs Time
for clock_tick = 2:total_time_units
time(clock_tick) = time(clock_tick-1) + deltat;
voltage(clock_tick) = voltage(clock_tick-1) + ...
deltat*(current_flow_in(clock_tick)/capacitance);
if voltage(clock_tick) > threshhold_voltage
voltage(clock_tick) = resting_voltage;
end
end
%%Formatting and Plotting the Output
plot(time,voltage,'-*r')
titlestr = horzcat('Integrate-and-Fire Neuron Model: ',modelstr);
title(titlestr,'fontsize',12,'fontweight','bold')
xlabel('Time (in t units)','fontsize', 10, 'fontweight', 'bold')
ylabel('Neuron Voltage (in V units)','fontsize', 10, 'fontweight', 'bold')
axis([0 total_time_units 0 1.20*max(voltage)])

채택된 답변

Arnaud Miege
Arnaud Miege 2011년 5월 31일
Have a look at this bug report and see if the suggested workaround fixes your problem.
HTH,
Arnaud
  댓글 수: 4
Arnaud Miege
Arnaud Miege 2011년 5월 31일
AS it turns out, there is:
http://www.mathworks.com/support/bugreports/678672
Joe M
Joe M 2011년 5월 31일
Outstanding! I followed the instructions found at the link that you provided, and it worked like a charm. Thanks again for your expert, forward-leaning assistance.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Simulink Report Generator에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by