matlab questions

matlab questions

  • All Sites

0 answers

In MATLAB, how do you compare the difference between two rows

An input is a data file with ID number of multiple occurrences. (e.g ID# 123) Now what I want is to gather all rows with same ID numbers, compare column by column, and see if what column do they have ...

0 answers

Placing cluster centers with S regular grid space

I started to working on MATLAB implemantation of following paper. http://www.kev-smith.com/papers/SMITH_TPAMI12.pdf At that paper I need to place K numbers of cluster centers on to a LAB spaced ...

0 answers

matlab: tricky vectorization of a loop where n-th value in depends on the n-th and n+k-th values

This is a looped version of a matlab program that works on an array of 55 values, the tricky part is that n-th value is being updated from the n-th and (n+31)-st, and in the second case, it's ...

1 answer

Save data variables from matlab to a csv or text file

I have a for loop that loop for k iterations and each time I save the output from the iteration into a variable see code below: dist(k)=sum(input~=Chosen_Output); fprintf('dist%d = %f \n', k, ...

1 answers | 56 mins ago by motaha on Stack Overflow stackoverflow.com
0 answers

Solving a differential equation in Matlab for different inputs

How do you look at only the endpoint in time (12 in this case) and see how changing a parameter at that point, such as a scalar in one of the differential equations, changes the data? function test ...

1 answer

Matlab: Delete the item in an N-dimensional array whose Nth dimension is 1, where N is unknown?

I have an N-dimensional array of items whose last dimension is the index of the array. For example, if the array A contained images, then A(:,:,:,1) would be the first image, A(:,:,:,2) would be the ...

1 answers | 1 hour ago by ingulit on Stack Overflow stackoverflow.com
2 answers

Detect corner coordinates of a non-convex polygon in clockwise order MATLAB

I have some images which includes both convex as well as non-convex polygons. Each image contains exactly one polygon. I need to detect the corner coordinates and need to sort them in clock-wise or ...

0 answers

solving nonlinear equations in matlab

I have a homework question that I cannot answer. Here is the question prompt: Define Eq. 8.3 and Eq. 8.4 in a function. This function should take a vector of joint angles (α and β) as input and ...

3 answers

Angle between two vectors matlab

I want to calculate the angle between 2 vectors V = [Vx Vy Vz] and B = [Bx By Bz]. is this formula correct? VdotB = (Vx*Bx + Vy*By + Vz*Bz) Angle = acosd (VdotB / norm(V)*norm(B)) and is there ...

3 answers | 2 hours ago by Jack_111 on Stack Overflow stackoverflow.com
1 answer

Count number number of rows until value is reached and do this within specific ranged within a dataset

I'm a beginner R user (not entirely sure if it's the most appropriate language for this use) and am having difficulty coming up with a solution for what I think is probably relatively easy. EDIT - ...

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

Matlab OOP: Create a handle class that (inherits from) is also a double?

I would like to create a class that inherits (and acts) as a double but is also a handle. For example: a = myHandleDoubleClass(); % Instance of my handle double. a.val = 1; ...

1 answer

provide time simulation in the stateflow chart

I would like to get the simulation time when I simulate my stateflow program, and I do not know which command can give me the time at each step of runing. Can you help me. Thank you.

1 answer

MATLAB code on cloud and returning data to android device

What are possible ways to run MATLAB code in a cloud and return the data (in this case a 3D image output) to an android application through web services?

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

simplify the answer or not in matlab

a=3^(1/2)+1; b=3^(1/2)-1; a*b ans = 2 a = 3- 21^(1/2); b = 21^(1/2)+3; a*b ans = -(21^(1/2)-3)*(21^(1/2)+3) I thought the second code would reply 12. Does anyone understand why? Thanks very much ...

0 answers

Matlab: Trained classifier is not shown correctly in ezcontour

OS: Windows 7 32bit Matlab: 2014b After a naive Bayes classifier is trained, I'm trying to plot an ezcontour (-plot).The necessary paramaters for ezcontour been calculated properly...or so far as I ...

1 answer

Call java library in Matlab

I need to add a java class library to Matlab. If I add the path to the static java class path in Matlab, Matlab cannot access it. But if I use javaaddpath() from the command-line and add the java ...

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

Saving and formatting text file with Matlab

I have a text file composed by two rows and the following format: "27 feb 2015","28 feb 2015","1 mar 2015",... "1","2","3","4",... How can I save these values in two arrays and plot them using ...

1 answers | 4 hours ago by narutov6 on Stack Overflow stackoverflow.com
1 answer

Converting From Cartesian to Polar Coordinates [Matlab]

i'm trying to convert the following data from Cartesian to polar coordinates using matlab. whenever i try to plot ,it comes out blank. Latitude=31.13; for h=-12:0.1:12 for ...

1 answer

How to plot a 3d graph of 2d fft tranformations with a changing parameter

I want to make a 3d plot of 2d plots of function y where y is the dft of function z with having as axis k(x) w0(y) and amplitude(y)(z), where k is the dft variable in frequency domain and w0 is a ...

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

MATLAB - why does this index exceed the matrix dimensions?

Hi I have this code which keeps giving me a "index exceeds matrix dimensions" error. I am trying to start the loop for h=1, d= 1 for 24 "h" and 3 "d" with a value for the "battery_capacity" matrix ...

3 answers

Trouble filtering potentiometer data (noisy, high spikes)

I've collected some data from a potentiometer using an Arduino microcontroller. Here is the data which was sampled at 500 Hz (it's a lot of data): ...

1 answer

pass HTTP “_method” header to urlread2 function in matlab

Hello I try to use the urlread2 function within matlab to send a request to a REST API. In general this does work already, but for one specific API call there is a documented bug in the API: Normally ...

1 answers | 6 hours ago by flimm on Stack Overflow stackoverflow.com
0 answers

Variable input to MATLAB function resets involuntarily inside while loop. How can I prevent it?

I have written a function which takes in an integer (int8) as one of the inputs (called iscool). The function runs a while loop and I insert an if-check inside it to break out of the loop. The ...

1 answer

How to solve parameter values from a system of non-linear equations in matlab

I'm a beginner in matlab. I have three non-linear equations spdratio_fw = ( 1 + afw*(vc_fw)^b); spdratio_pa = ( 1 + aps*(vc_pa)^b); ind = (ddhv_fw*( 1 + afw*(vc_fw)^b) - ddhv_pa*( 1 + ...

1 answers | 6 hours ago by sayan de sarkar on Stack Overflow stackoverflow.com
0 answers

Incremental SVD implementation in MATLAB

Is there any library/toolbox which has implementation of incremental SVD in MATLAB. I have implemented this paper, it is fast but does not work well. I tried this but in this also error propagates ...

1 answer

Replace pixels with symbols

I am trying to write a function that would take an indexed image as an input and will replace all its pixels by symbols or characters. An image is worth more than a 1000 words: This is the desired ...

3 answers

How to create equivalence class from an array in matab

I am working on matlab. Let, I have an array as following a = 2 1 5 3 2 1 2 1 You can see there may be one value multiple times.I want a function that will give me an array for each of those ...

3 answers | 7 hours ago by Surajeet Bharati on Stack Overflow stackoverflow.com
1 answer

Creating a System Impulse Response in Matlab

Preface: I'm extremely new to Matlab. Ok, so I have a sound file that I loaded in Matlab. Two variables are loaded: xx - the speech waveform - 16001 samples fs - the sampling frequency of the ...

1 answers | 7 hours ago by Ramrod on Mathematics math.stackexchange.com
3 answers

Tips for golfing in MATLAB

What general tips do you have for golfing in MATLAB? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to MATLAB (e.g. "remove comments" is ...

1 answer

Matlab angle2dcm different definition

I am using MATLAB function angle2dcm which gives me different results from what I expected. By digging into the code (angle2dcm.m) I found the definition of forming the rotation matrix is different ...

15 30 50 per page
1 2 3