Category "matlab"

Can I save a function's arguments in Matlab to reuse in another function?

I am using the topoplot function in Matlab as follows: topoplot(DATA, channels, ... 'maplimits', topoYlim, 'electrodes', 'on', 'emarker', {'.','k',[6],1},

Is Ternary operation valid in Octave?

Question is ternary operation valid as i am not able to find any document related to it online. And i also find out that ternary is not possible in MATLAB so an

Fitting steps of different amplitude to data using Matlab

I want to fit steps to the data in blue shown in the attached image to get the estimate of their amplitudes as shown in red (I drew those lines using Powerpoint

Accessing Simulink Functions from inside Atomic Subchart

For reasons far outside my control, I have now been thrust into doing MATLAB/Simulink/Stateflow work. I've done the On-Ramp training, and already I despise how

Imitate ode45 function from MATLAB in Python

I am wondering how to export MATLAB function ode45 to python. According to the documentation is should be as follows: MATLAB: [t,y]=ode45(@vdp1,[0 20],[2 0])

Matlab wrapToPi and python np.unwrap

I am trying to port my code from Matlab to Python. Most of it seems to work except Matlab's function wrapToPi I am using numpy's unwrap function np.unwrap

Vector reversal using recursion

I'm supposed to reverse the order of an array. I was asked to break the array into two halves and run two recursive functions on each half. When I run the funct

How to prune some unnecessary branches from the Voronoi diagram?

I generated the Voronoi diagram using the following MATLAB code. The problem is that in the output image I obtain some useless lines that I want to remove. By u

MATLAB: Subindexing in cell array based on results of strfind

I have a cell array, like so: ID = {'g283', 'sah378', '2938349dgdgf', 'g283'}; I also have some data that corresponds to these IDs. Data = {'data1', 'data2'

Finding median eigenvalue with sparse matrix in r

I am working with SVD on a matrix $$Y_{m,n} = T_{m,m} \Sigma D^T_{n,n} $$ where $T$ and $D$ describe the row and the column entities of Y, respectively. The tru

Open .mtx file in MATLAB

I have a .mtx file which contains a vector which I am suppose to use for matrix vector multiplication. I tried to open the file using fopen('filename') but this

Is there Python command similar to the 'return' function in MATLAB?

Is there function in Python to can return control to the invoking script or function, similar to the function return in MATLAB? Does the function exit() or quit

Matlab App built in runtime 9.10 runs significantly slower in runtime 9.7

I have an app I wrote in Matlab app designer, built in Matlab 2020a (v9.10 runtime environment). I have to compile it in v9.7 runtime though. When I do this it

How to write a function in MATLAB

I want to write a function that returns the value of f(y) for any value of y: f(y) =tan( sin(y) - sin(tan(y)) ) How can I write this as a function in MATLAB?

how to replace the ode45 method with the runge-kutta in this matlab?

I tried everything and looked everywhere but can't find any solution for my question. clc clear all %% Solving the Ordinary Differential Equation G = 6.6740

LUT for sin: calculation sin of x in Matlab

I test sin computation via LUT in Matlab. Nsamples_LUT = 2^10; Nbits_sine_LUT = 14; sine_LUT = sin( (0:Nsamples_LUT-1) / Nsamples_LUT * 2 * pi ) * (2^(Nbits_si

How to read a .mtl model file into MATLAB and visualise it?

Does anyone know how to read a .mtl 3D model file into MATLAB and visualise it? The .mtl file looks like following newmtl body Ns 51.0000 Ni 1.5000 d 1.0000 Tr

Matlab Special Matrix

Is there a MATLAB function to generate this matrix?: [1 2 3 4 5 6 7 ... n; 2 3 4 5 6 7 8 ... n+1; 3 4 5 6 7 8 9 ... n+2; ...; n n+1 n+2 ... 2*n-1]; I

Is the Matlab Cascade Object Detector (using LBP) Invariant to In-Plane Rotation?

I have read that LBP can be used for rotation invariant feature detection, such as here. This makes intuitive sense to me, as LBP is effectively evaluating loca

Pytorch unable to export trained model as ONNX

I have been training a model in the Pytorch framework using multiple convolutional layers (3x3, stride 1, padding same). The model performs well and I want to u