1 answer

Generating a matrix to describe a two-dimensional feature

Let's say I have a vector A = [-1,2]; Each element in A is described by the actual number and sign. So each element has a 2 dimensional feature-set. I would like to generate a matrix, in this case ...

0 answers

Matlab GUI loaded image glitch when drawing axes

I have a GUI in MATLAB that loads an image of the program acronym (see link 1). Link 1 At a later step in the program, I draw the following plot in a separate panel (see link 2). Link 2 When it ...

0 answers

Reading Matlab mat file with C++

I'm trying to read a Matlab .mat file with C++, using Matlab's MAT File API. An example code: #include <iostream> #include <stdio.h> #include <stdlib.h> /* For EXIT_FAILURE, ...

1 answer

How to use fzero in MATLAB

I would like to use fzero to approximate the root of x+sin(x)=e^x close to -1. However, fzero just seems to return the guess I provide: > fzero('x+sin(x)==e^x', -1) -1 > ...

1 answers | 2 hours ago by user4999605 on Stack Overflow stackoverflow.com
0 answers

What is the best way to convert Matlab multidimensional cell array to Javascript array?

I have a 4D Matlab matrix that I wish to convert into a Javascript 4D array. What is the best way to do this? Currently my tentative approach will be to either: 1) Write the Matlab matrix into a ...

0 answers

Filtering rectangles of hog detection

I'm implementing hog and svm on Matlab for detecting players. When I want to test it on an image, I get multiple rectangles on each player. I want to filter this rectangles and pick the best one. ...

0 answers

Simulink: soft-body simulation?

One of my professors mentioned how Simulink models could be combined with Finite Element Analysis results from, for example, Abaqus, in order to create high-fidelity simulations of a mechanism where ...

1 answer

Sorting a block subset from a sorted vector

I am working in Matlab and I have an unsorted vector X. I then extract a random subset from X by taking random blocks and denote the subset as Y. For example, we could have Y=X([1:3, 10:12, 16:18]). ...

1 answers | 4 hours ago by KMoon on Stack Overflow stackoverflow.com
8 answers

How can I count the number of elements of a given value in a matrix?

Does anyone know how to count the number of times a value appears in a matrix? For example, if I have a 1500 x 1 matrix M (vector) which stores the values of weekdays (1 - 7), how could I count how ...

8 answers | 5 hours ago by Niko Gamulin on Stack Overflow stackoverflow.com
3 answers

Matlab Coder : Matlab Array to C Array

I used matlab coder to convert a matlab code to C. The simple array I had defined in matlab got converted to a complicated struct in C. struct emxArray_real_T { double *data; int *size; int ...

3 answers | 5 hours ago by user4009004 on Stack Overflow stackoverflow.com
1 answer

MATLAB - How to resolve “Subscripted assignment between dissimilar structures” ERROR

I have a struct called A which has a [1x1] struct called B, and when I run A.B in the command line, it returns two types of answers: ans = X: 3 Y: 2 Z: 4 ans = X: 1 Y: 5 Z: ...

1 answers | 5 hours ago by Dan on Stack Overflow stackoverflow.com
1 answer

Indexing issue in MATLAB (image processing)

I'm dealing with a predictive block-matching motion estimation algorithm. This means, the values of motion vectors are found using the previously found values and I am stuck with a really trivial ...

1 answer

Animation of 2D plot in Matlab

I have a setup that measures the temperature profile of a piece of equipment at an interval using 11 probes and I wish to make an animated plot for how the profile evolves. I have my temperature data ...

1 answers | 5 hours ago by mendokusai on Stack Overflow stackoverflow.com
0 answers

Reading the stuff between two delimiters in MATLAB

I wanted to read the values between two delimiters. The file's format is like this: * 1 5 1.000000 2 1 2 1 2 2 1 2 1 3 2 3 2 4 2 4 2 5 1 5 1 # 2 1 2 2 1 $ 0.878148 0.135812 * * 2 5 ...

2 answers

Reading complex numbers in comma separated format from a text file into a MATLAB variable

I have a text file with complex numbers in the format shown below, (1.00000000,-0.00000000) (0.66914010,0.74313629) (-0.10450304,0.99452454) (-0.80899447,0.58781630) (-0.97815824,-0.20786168) ...

2 answers | 6 hours ago by Naveen on Stack Overflow stackoverflow.com
3 answers

Accurate Signal Filtering

I'm looking for some ideas to filter a noisy signal. my sampling Condition is : Ferequency Sample Rate : 8000 Hz Number Of Signal Sample : 32000 Byte ( about 4 Seconds) I want to extract 15.84 Hz ...

1 answer

matlab: splitting small arrays by latitude/longitude into individual grid cells of one large array

I have multiple satellite orbit paths that cover different latitudes/longitudes, but are all bounded by the same overall lat/lon grid (below). I am trying to split the data from each orbit path into ...

0 answers

Passing string variable as function's argument - MATLAB

Could anyone assist on the way i could pass a string variable to my function? Please see below my function: function x=getsqldata(var); Set preferences with setdbprefs. ...

0 answers

executing an instruction in matlab function called in C #

I have a c# code that reads measurements from multiple sensors via the serial communication COM16. But at each instant I can see only the current value. How can I send these data in real time to ...

2 answers

mex file not executing in Matlab 7.5.0 (R2007b)

I created a mex file of a matlab file test.m from matlab R2012b using matlab coder. I got the output file test_mex.mexa64 . I was hoping to use this mex file in Matlab 7.5.0 (R2007b) but it shows the ...

2 answers | 8 hours ago by sreekanth on Stack Overflow stackoverflow.com
0 answers

BER in Rayleigh Simulink channel

I'm using the Rayleigh Channel in Simulink but I can't calculate the BER. I always get values near to 0.5 which doesn't make sense (even using high EbNo values). In this simulink model I found a trick ...

0 answers

data optimization, Matlab: ode for a system of diff. equations

I can not figure out why the following code treating one chemical kinetics problem can not fit the 'data' with the system of differential equations (function KIN), which also have analytical solution ...

1 answer

MAtlab: Inaccurate fit for general model fittype

I'm trying to fit a dataset with a function defined by fittype. First I tried to create a linear model for my function linfun=fittype({'x.^-4'}), then I created the same function as a general model ...

1 answers | 9 hours ago by D. Dequal on Stack Overflow stackoverflow.com
1 answer

Changing a code to get the Goldbach conjecture

To test the Golbach conjecture I have found the following code, but when I ren it out, this only gives me the number of combinations of primes, but in fact what I was searching for are the primes,I ...

1 answers | 9 hours ago by user162343 on Stack Overflow stackoverflow.com
2 answers

“TypeError: buffer is too small for requested array” when attempting to read a .mat file using scipy.io.loadmat

I have such a code: import tempfile import subprocess import shlex import os import numpy as np import scipy.io script_dirname = os.path.abspath(os.path.dirname(__file__)) def ...

2 answers | 10 hours ago by yusuf on Stack Overflow stackoverflow.com
1 answer

Matlab Color Quantization

I'm currently working on project which is related with color quantization.The algorithm implies as initial step k-means algorithm . My code untill now : N = 10; K=7; I=imread('baboon.bmp'); Idouble ...

1 answer

Imrect doesn't get the correct size

I am showing an image so the user can select different ORI with the shape of rectangles always. My problem is that when I see the results of getPosition it gives me an x, y, width and height strange ...

0 answers

MatLab scatter plot

I am trying to generate a scatter plot within a current figure that has a gradient color. My gradient color works when I run the scatter plot in its own figure. however, when I add the scatter plot to ...

0 answers

How to read data every second in serial communications using matlab

I would like to read data every one second from the device but i am unable to do it. I have tried with the following code. Here is the code... ...

1 answer

ABAQUS errors: File open failed (utl_File: CreateFile in OpenWrite) error: T?

I'm trying to loop an ABAQUS macros in MATLAB. The last bit of the macros is save the CAE file, submit the INP file. I'm using 'system' command in MATLAB to loop this macros. In MATLAB, the ABAQUS ...

1 answers | 11 hours ago by thinkvantagedu on Stack Overflow stackoverflow.com
15 30 50 per page
1 2 3