Category "matlab"

Error while using mex file in Colab with Octave

I am trying to use MATLAB in Colab. MATLAB is run in Colab through Octave. I have to use the MR8fast() filter, which in turn uses anigauss.c. I could successful

how to write ant colony optimization code

i have a function function t=strength(x) t(1) = -0.804-0.001.*x(1)-0.001.*x(2)+0.0.*x(3)+0.0.*x(4)-0.031.*x(5)+0.005.*x(6)-0.002.*x(7)+0.001.*x(8)-0.735.

Output doesn't come. Plotting issue [Matlab to python conversion]

This is my Pyhton code. import numpy as np import matplotlib.pyplot as plt n = 3; #% No of image T = 100;

python equivalent code for matlab histogram

I am manually trying to convert a matlab code to Python for my application. The Matlab code is this: % BUILD HISTOGRAM % Specify bin centers of the histogram b

SSM model Standard errors Matlab covariance matrix

Does anybody know please how to obtain standard errors of estimates parameter in SSM model matlab? or how to get them from covariance matrix?

Equivalent functionality of Matlab unique() in MathNET.Numerics?

Is there a MathNET.Numerics equivalent of Matlab’s unique(A, 'rows') (or unique(A)), where A is a Matrix<double>? I have searched extensively throug

Filling in plot animation (polar function)

I have a set of videos shown in an assignment. How is this animation created? I am trying to create something similar. Below is my attempt; it is only drawing

How to test multiple different type return value in unit test?

My code and test code are as follows: return two value, one is vector, and is boolean. Using command to test is ok. But in unit test it is in error. command tes

Double lexicographic sorting of binary (0-1) matrices

I want to sort a binary matrix so that its columns and rows are both in lexicographical order by switching rows and columns. In other words, I need a double-lex

Switch between two map axes in Matlab

Is there a way to switch between two map axes in the mapping toolbox in Matlab? I created a basemap, then I created a small inset to show the map location in

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},

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'