Problem with initialization bim's ready example in Octave - octave

On assignment, they gave me a step-by-step example from this article http://wiki.octave.org/Bim_package.
The example was typed manually, without copy-paste.I already install this packages- fpl, bim,msh, image.
Octave example:
pkg load bim
pkg load msh
pkg load fpl
[mesh]=msh2m_gmsh("fuime","scale",1,"clscale",.1); – Error
[mesh]=bim2c_mesh_properties(mesh);
pdemesh(mesh.p,mesh.e,mesh.t);
view(2)
xu=mesh.p(1,:).';
yu=mesh.p(2,:).';
nelems=columns(mesh.t);
nnodes=columns(mesh.p);
epsilon=.1;
phi=xu+yu;
AdvDiff=bim2a_advaction_diffusion(mesh,epsilon,1,1,phi);
Mass=bim2a_reaction(mesh,1,1);
b=bim2a_rhs(mesh,f,g);
A=AdvDiff+Mass;
GammaD=bim2c_unknowns_on_side(mesh,[1 2]);
GammaN=bim2c_unknowns_on_side(mesh,[3 4]);
GammaN=setdiff(GammaN,GammaD);
jn=zeros(length(GammaN),1);
ud=3*xu;
Omega=setdiff(1:nnodes,union(GammaD,GammaN));
Add=A(GammaD,GammaD);
Adn=A(GammaD,GammaN);
Adi=A(GammaD,Omega);
And=A(GammaN,GammaD);
Ann=A(GammaN,GammaN);
Ani=A(GammaN,Omega);
Aid=A(Omega,GammaD);
Ain=A(Omega,GammaN);
Aii=A(Omega,Omega);
bd=b(GammaD);
bn=b(GammaN);
bi=b(Omega);
temp=[Ann Ani;Ain Aii]\[jn+bn-And*ud(GammaD); bi-Aid*ud(GammaD)];
u=ud;
u(GammaN)=temp(1:numel(GammaN));
u(Omega)=temp(length(GammaN)+1:end);
jd=[Add Adi Adn]*u([GammaD;Omega;GammaN])-bd;
[gx,gy]=bim2c_pde_gradient(mesh,u);
[jxglob,jyglob]=bim2c_global_flux(mesh,u,epsilon*ones(nelems,1),ones(nnodes,1),ones(nnodes,1),phi);
fpl_vtk_write_field("vtkdata",mesh,{u,"Solution"},{[gx:gy]',"Gradient"},1);
pdesurf(mesh.p,mesh.t,u);
In this - [mesh]=msh2m_gmsh("fuime","scale",1,"clscale",.1);Error
Generating mesh...
error: 'tmpnam' undefined near line 78, column 78
error: called from
msh2m_gmsh at line 78 column 12
>>
WHAT HAVE I TAKEN TO FIX THE ERROR
I decided that the problem is in uninstalled packages.
According to the answer I was given in this thread Error,when installing a new package in Octave.
I started to install the package mesh, but here another error came out.
error: get_forge_pkg: package not found: "mesh". Maybe you meant "lssa?"
error: called from
get_forge_pkg at line 90 column 5
get_forge_download at line 32 column 14
pkg at line 500 column 31
But the mesh package not found.The package msh already installed.
How I can fixed my problem?

Related

How to load a user specified file in Octave

I have a very short script that I'm running in Octave and I want to read a user specified text file. It works on my 64-bit laptop, but not on my 32-bit one. The Octave version is 3.2.2.
plotinfra.m
filename=uiputfile
data=load(filename);
plot(data(:,1),data(:,2));
On my other laptop, this brings up a filesystem menu where I can choose the specific file to load. On this laptop, I see this error message instead:
error: uiputfile undefined near line 1 column 19 error: called from: error: plotinfra.m at line 1, column 17
If I hardcode filename with a path it works. I also tried using uigetfile and that did not work either.
Version 3.2.2 of Octave was released in 2009. When I enter edit uiputfile in Octave, at the top of the file I see the line:
## Copyright (C) 2010-2019 Kai Habel
Thus, it seems that this function was created after your release of Octave. This is the reason you get a "uiputfile undefined" error message.
You will have to upgrade your version of Octave to use this function.
I'm using Ubuntu 18.04 64Bit Linux Octave 4.2.2 see if this works for you. It will store the filename in the variable file_name and the path location in the variable path_dir
% create your dataset (exampledata)
x = (-1:0.1:1);
y = sin(x);
data = zeros(length(x),2);
data(:,1) = x;
data(:,2) = y;
% save data to file (your textfile)
save('-ascii','data2.txt','data');
%load textfile
%data2 = load('data2.txt'); %hard coded
[file_name,path_dir] = uigetfile('*.txt'); %pops up uibox choose data2.txt
data2 = load(strcat(path_dir,file_name)); %loads the file and the data
%plot data
plot(data2(:,1),data2(:,2));

GNU Octave error message

When I load Octave each time I get the below errors after the welcome/info message.
error: `prefix' undefined near line 12 column 35
error: evaluating argument list element number 2
error: called from:
error: C:\Octave\Octave3.4.3_gcc4.5.2\share\octave\site\m\startup/octaverc at line 12, column 1
octave:1>
Does anybody know why this is happening?
For that version of octave, the default settings of that file around that line are:
prefix=octave_config_info('prefix');
setenv('path',[getenv('path'),';',prefix,'\mingw32\bin;',prefix,'\msys\bin']);
setenv('path',[getenv('path'),';',prefix,'\gs\gs9.02\bin'])
So you should check if it has changed

I am getting the following error while trying to use the library function fminunc in octave

error: 'cholupdate' undefined near line 209 column 14
error: called from
fminunc at line 209 column 12
ex2 at line 86 column 13
My C drive had run out of space so the installation probably didn't succeed properly.
Reinstalling Octave after clearing space has fixed the issue.
Thanks for your help.

`regionprops' undefined on Octave

I would like to use Matlab regionprops function in Octave.
I am getting error: `regionprops' undefined:
octave-3.2.4.exe:744> s = regionprops(Image, 'centroid');
error: `regionprops' undefined near line 744 column 6
Is there a way to use it? How do I proceed?
Install the Image package available at http://octave.sourceforge.net/image/index.html

Octave crashes on matrix multiplication of dimension 52 by 52

magic(5) * magic(5) // works
magic(52) * magic(52) // fails
panic: Illegal instruction -- stopping myself...
attempting to save variables to 'octave-core'...
save to 'octave-core' complete
I am on Ubuntu 13.04, 32 bit, linux kernel 3.8.0-31-generic
I tried uninstalling atlas as mentioned here but could not find libatlas3gf-base so removed fgfs-atlas instead but that did not work.
Install the following packages first
libblas3gf
libblas-doc
libblas-dev
liblapack3gf
liblapack-doc
liblapack-dev
And if that does not work, search for 'blas linear' in your software package manager and install all except for Java,python,perl etc.
Ref: http://ubuntuforums.org/showthread.php?t=1505249