I have the script file and function file.
The script file use ode45 to solve differential equation from function file.
close all; clearvars; clc; [z,x,B] = ode45(@Fdiff,[0:5],1);
function [dxdz,B] = Fdiff(z,x) A = 5 + 10; B = x(1) * A; dxdz(1) = x(1) + B; dxdz = dxdz'; end
In the script file (top), I want to read the value of B in the function file as well.
So I add B to the output of the function in Fdiff.
But it does not work, the value of B read as .
How to read value of B in the function file from script file?
GNU Octave, version 7.1.0 (Flatpak)
Operating System: openSUSE Tumbleweed 20220428 (Linux)
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.2
Kernel Version: 5.17.4-1-default (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 4600H with Radeon Graphics
Memory: 7.1 GiB of RAM
Graphics Processor: AMD RENOIR