octave

octave error undefined near line 1 column 1

北战南征 提交于 2020-01-16 14:37:34
问题 I try to read a matrix from a file. The code is very simple function [mat] = read(file) mat = load(file_points) But when I try to run it read('file') mat = scalar structure containing the fields: mat = 3 4 6 3 5 1 it shows the matrix, but when I run this command... >>mat(1,1) error: 'points' undefined near line 1 column 1 回答1: From Octave Forge about load() If invoked with a single output argument, Octave returns data instead of inserting variables in the symbol table. If the data file

How to execute an Octave file using php

巧了我就是萌 提交于 2020-01-16 02:26:10
问题 I have an Octave file sr.m sqrt(3^2 + 4^2) I have to execute this file using PHP and display output in browser. The sr.m file is resides in octavepgm folder in Desktop . my php code is $cmd = "octave3.6.4 -qf C:\\Users\\deepu_000\\Desktop\\octavepgm\\sr.m"; $ex = passthru($cmd, $output); var_dump($output); This gives int 1 as output. How can I make this working..please help me.. The expected output is 5. 回答1: There's several issues which I explain further down but here's how you do it: $ php

How to call a shadowed function in Octave?

人走茶凉 提交于 2020-01-15 02:54:49
问题 I want to modify the behaviour of the vpa function. For that I define my own function called vpa that calls the original vpa function and then does some more stuff. To call the original function from within my modified function I use y = builtin('vpa', varargin{:}); where varargin is a cell array of the function inputs, as usual. The problem is that the above produces a different result than calling the original vpa function. Minimal example, run on Octave 4.2.2: >> vpa([4 5], 20) ans = (sym)

Any Support for Matlab or octave in intellij

我与影子孤独终老i 提交于 2020-01-14 08:54:06
问题 I code in Matlab/octave very often. While having several good features it lacks a good editor. My question is that is there any other good editor for it. My preference is intellij Idea, which is one the best IDEs I've ever tried. In this regard, can I connect octave or matlab to intellij (e.g. via some plugins)? 回答1: I've implemented Matlab plugin for IntelliJ: https://github.com/kornilova-l/matlab-IntelliJ-plugin It has syntax highlighting, resolve, rename and autocompletion. I continue

increase / decrease the frequency of a signal using fft and ifft in matlab / octave

早过忘川 提交于 2020-01-14 05:54:48
问题 I'm trying to increase / decrease the frequency of a signal using fft and ifft. The first plot is 1hz and the second plot is 2hz which I'm trying to get by altering the fft and ifft values . I can go between the frequency domain and time domain but how can I increase or decrease the frequency of the signal using fft / ifft? Note: Yes I know I could change the frequency by changing the frequency value of the equation but I'm just using that as a test signal. The signals I will be using won't

Octave hangs when you first use graphic functions (plot, imagesc, etc.),

六月ゝ 毕业季﹏ 提交于 2020-01-13 19:16:47
问题 When I first use the plotting functions (for example, plot(1,1) ), Octave hangs for a few minutes. The second and subsequent calls for the same functions are performed quite quickly. The same behavior is repeated the next time you start Octave. I used Octave 4.2.1 with both qt graphics_toolkit and gnuplot graphics_toolkit. Operating system was Windows 7 and 10. I used standart Octave Installer. How to solve this problem? 回答1: This problem is quite common. See for example - Cannot use Octave 4

Reset ColorOrder index for plotting in Matlab / Octave

怎甘沉沦 提交于 2020-01-12 07:13:08
问题 I have matrices x1, x2, ... containing variable number of row vectors. I do successive plots figure hold all % or hold on plot(x1') plot(x2') plot(x3') Matlab or octave normally iterates through ColorOrder and plot each line in different color. But I want each plot command to start again with the first color in colororder , so in default case the first vector from matrix should be blue, second in green, third in red etc. Unfortunately I cannot find any property related to the color index

Converting Octave to Use CuBLAS

…衆ロ難τιáo~ 提交于 2020-01-12 06:19:03
问题 I'd like to convert Octave to use CuBLAS for matrix multiplication. This video seems to indicate this is as simple as typing 28 characters: Using CUDA Library to Accelerate Applications In practice it's a bit more complex than this. Does anyone know what additional work must be done to make the modifications made in this video compile? UPDATE Here's the method I'm trying in dMatrix.cc add #include <cublas.h> in dMatrix.cc change all occurences of (preserving case) dgemm to cublas_dgemm in my

Converting Octave to Use CuBLAS

强颜欢笑 提交于 2020-01-12 06:18:27
问题 I'd like to convert Octave to use CuBLAS for matrix multiplication. This video seems to indicate this is as simple as typing 28 characters: Using CUDA Library to Accelerate Applications In practice it's a bit more complex than this. Does anyone know what additional work must be done to make the modifications made in this video compile? UPDATE Here's the method I'm trying in dMatrix.cc add #include <cublas.h> in dMatrix.cc change all occurences of (preserving case) dgemm to cublas_dgemm in my