octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #54722] Publishing document with sections does


From: STPR
Subject: [Octave-bug-tracker] [bug #54722] Publishing document with sections does not carry over variables
Date: Mon, 24 Sep 2018 22:19:09 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0

URL:
  <https://savannah.gnu.org/bugs/?54722>

                 Summary: Publishing document with sections does not carry
over variables
                 Project: GNU Octave
            Submitted by: theillusiveman
            Submitted on: Tue 25 Sep 2018 02:19:08 AM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.1
        Operating System: Any

    _______________________________________________________

Details:

I recently realised that octave has a publish() function. I was trying to see
if I could publish some scripts from my research in Octave. It appears to me
that if your script contains sections (separated by %%), then any variable or
function declared in any previous section is not available to the following
sections. .

As an example, put the following lines in a script and publish the script:


clc;
clear;
close all;
%% 1. Plot a Sin()

myFun = @(t) sin(2*pi*2*t);
fs = 100;
t = (0:99)/fs;
x = myFun(t);
figure;
plot(t, x);
%% 2. Plot Sin^2()
y = myFun(t).^2;
figure;
plot(t, y);


This would generate an HTML file with the following error:

2. Plot Sin^2()

y = myFun(t).^2;
figure;
plot(t, y);

error: 't' undefined near line 3 column 11
        in:
y = myFun(t).^2;
figure;
plot(t, y)


It appears to me as if each section is run independently when being published.
However, just running the script results in no issues. Publishing the same
script in MATLAB works without any problems.




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54722>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]