matlab questions

matlab questions

  • All Sites

2 answers

What is the right way to extract particular frequency phase information from FFT?

Signals acquisition: Two proximity sensors are positioned Orthogonal to each other. These would be measuring the vibrations of a rotating shaft. Problem: Each of these 2 signals has two dominant ...

0 answers

rehshape image to 3 columns matrix matlab vs openCV

Here is the matlab code: accum1r = imresize(accum1, n2_points, 'bilinear','AntiAliasing',false); time_mean_unsorted = reshape(accum1r, [], 3) ./ n_frames; here is my openCV code cv::Mat ...

1 answer

How to implement multi-class SVM with Leave-One-Out method in Matlab?

How I can classify a data set (has 11 classes) using SVM with Leave-One-Out method? Any help to modify below code will be appreciated. N = 1500; % Number of samples indices = crossvalind('Kfold', ...

1 answer

Exact indices of fft

Lets consider the cyclic frequency transform and lets try to make it so that the transform of the function is itself. t=linspace(-32,32,4096); dt=t(2)-t(1); fq=linspace( -1/(2*dt) , 1/(2*dt) , ...

1 answers | 1 hour ago by grdgfgr on Signal Processing
0 answers

solving a system of nonlinear equations in matlab

Suppose we wish to determine the economic operating point of these three units when delivering a total of 850 MW. Write Matlab code to solve it. C1(P1)=561+7.921(P1)+0.0015621(P1^2) ...

0 answers

fitcdiscr for LDA (Linear Discrimation Analysis) in MATLAB

I have created a feature matrix of 72x25 size (X) from 72 images(36 of which are grass images and 36 of which are straw images) and 25 corresponds to the features I have calculated for each image. Now ...

1 answer

Matlab second y-axis label does not have the same “padding” as the first

I made a plot and wanted to add a second y-axis with different units of measurement. Here is what I did: ... ... plot(x,y,x,y1,x,y2) ax1=gca; set(gca,'YTickLabel',num2str(get(gca,'YTick').')) ...

2 answers

How to properly use memory dynamically allocated in C++ dll within Matlab

I wrote a C++ interface dll to call some key image processing statistical measuring methods from Intel's Integrated Performance Primitives (IPP) library so we can exploit SIMD capabilities. I was able ...

0 answers

Have a string search set up in Matlab, how do I skip a string if none is found?

I have some data marked by a set of string markers that start with a 1 for the start, and a 2 for the end row of the data. These strings are a fixed list that I search from. If a string is not found, ...

0 answers

Integrate C function with multiple outputs built with MATLAB Coder

I have been coding in MATLAB and I managed to convert my work to a single function, however it has several inputs and outputs. For the sake of simplicity, lets say it receives three inputs: X ...

1 answer

Function m-files with loops

I need to make a function called newsign that inputs a function handle (f) and a real,positive, and small number (d). I can assume that f(0) is not 0, that f(x) is continuous on [0,∞), and that ...

0 answers

Implementing Gilbert-Peierls for LU decomposition by matlab or c

here is a link of what it does

1 answer

Matlab : Turning a script with symbolic variables into a function

I am building a double pendulum simulation . Now i have written a script with symbolic variables and parameters. I want to turn the script into a function using input value for some of the symbolic ...

1 answers | 3 hours ago by Grunwalski on Stack Overflow
0 answers

Filling hatched areas in image

I'm trying to extract / fill the walls in a floor plan, the walls are filled with a (cross-)hatch pattern at a more or less fixed angle. I've managed to remove most of the "noise" by masking the DFT ...

3 answers

How detect and filter noise from signal

This is the spectrum of the signal: And this is the signal: On the FFT spectrum you can notice the high amplitude peaks and I think these frequencies are the main ones in the signal: I think ...

2 answers

How to shift columns in a matrix to the right in MATLAB?

Given the following Problem: How can I achieve this? I am trying to shift the columns to the right, but I can only get them to shift to the left. I also cannot account for the column on the end being ...

2 answers | 4 hours ago by user3006937 on Stack Overflow
1 answer

Produce image in MATLAB

I am new in MATLAB and I am trying to produce an image which contains every 2nd or 4th pixel. what I am trying to do: image1 = false(256,256); image2 = false(256,256); image1(:, 1:2:end) = ...

1 answers | 4 hours ago by user4475661 on Stack Overflow
0 answers

In MATLAB, how can I combine 2 different `histc` results into one, and produce a 3D plot?

In one histc, I have latitude data. In another histc, I have longitude data. I have plotted the bar graphs of these 2 separately. Now, I want to combine them and produce a 3D graph where the x-axis is ...

2 answers

How can I save a file with diferent names on each iteration in a loop? MATLAB

I have a file that on each iteration in a loop changes the name,and i want to save it on each iteration with the name that he have on this iteratio. Its possible? How can i do it? Thank you very much ...

2 answers | 4 hours ago by Traker on Stack Overflow
0 answers

plotly fig2plotly(gcf,'strip',false). doesnt work

I am using plotly and I am trying to preserve my matlab style instead of the plotly style. A simple example is [X,Y] = meshgrid(-8:.5:8); R = sqrt(X.^2 + Y.^2) + eps; Z = sin(R)./R; ...

3 answers

Searching for a fast/efficient histogram algorithm (with pre-specified bins)

I don't do much coding outside of Matlab, but I have a need to export my Matlab code to another language, most likely C. My Matlab code includes a histogram function, histc(), that places my input ...

3 answers | 5 hours ago by ggkmath on Stack Overflow
2 answers

Generation of random Matrix with Real eigen values

does anyone know any matlab algorithm that can help me generate a random matrix with REAL EIGEN values? Thanks.

1 answer

Matlab Error Expression or statement is incorrect--possibly unbalanced

Hello i get this error when i run the program I think it is from e (exponent) the question is Show that the function f(x) = e^x −(x^2/2) -x -1 has zero of multiplicity 3 at α = 0 and then, find the ...

1 answers | 6 hours ago by Badr on Stack Overflow
3 answers

How can I change the path in a loop? MATLAB

i want to change the path of a file on each iteration in a loop. How can i do it? for i=1:N for j=1:M image=imread('ORDENADOR/Sample001/img001-00001.png'); end end I want to ...

3 answers | 6 hours ago by Traker on Stack Overflow
1 answer

Matlab fmincon Not Yielding Global Maximum/Minimum

I am new to matlab, apologies if the question is silly. I am using the fmincon function to derive the elements of a matrix (X) which will maximize the following objective function subject to the ...

1 answer

Matlab, expanding, simultaneous equation solving for a control system

I have this code in matlab syms L1 L0 P1 P0 s L = expand(s*(s^2+L1*s+L0)*(s-75)+1400*(P1*s+P0)) R = expand((s+75)*(s+150)^3) I want to solve for P1, P0, L1 and L0 L = R 1400*P0 - 75*L0*s + ...

1 answers | 7 hours ago by Joe Dusta on Stack Overflow
0 answers

how to use matlab forward feature selection to choose the best features?

Can somebody explain how to use "sequentialfs" function in Matlab to choose the best features between 40 features? I have one matrix with 100000 row and 40 columns (columns are my features such as ...

4 answers

implementation of Fourier denoising with hard threshold

I just tried the Fourier denoising method with a hard threshold and my code is as follow: F = imnoise(phantom(128),'gaussian'); B = fft(F); s = 0.3; for i = 1:128 for j = 1:128 if ...

1 answer

Matlab / Datafeed compiled code with Bloomberg APIv3 / Java library: Java Exception

Am trying to compile Matlab code that employs Bloomberg's APIv3 via the Datafeed toolbox. The code runs fine within Matlab. The compiler works fine on code without Java. The javaclasspath references ...

1 answers | 8 hours ago by Martin on Stack Overflow
0 answers

Unable to include simstruc.h, fixedpoint.h and in eclipse c project

I have used real time workshop in matlab to generate c code for a model. When I try to import this code into a new c project in eclipse and build I get this error: unresolved inclusion simstruc.h ...

15 30 50 per page
1 2 3