1 answer

Check whether there is a text at certain location on Matlab figure

Is there any possibility to check whether there is a text at certain location on Matlab figure before print some text on that location? I mean, some times if we have many curves and if we add some ...

1 answers | 7 mins ago by John Nash on Stack Overflow stackoverflow.com
2 answers

Fastest way to find the sign of different square

Given an image I and two matrices m_1 ;m_2 (same size with I). The function f is defined as: Because my goal design wants to get the sign of f . Hence, the function f can rewritten as ...

0 answers

SVM: why only count the first two column features

I found a SVM example online. I do not understand why only count the first two columns of features. The data set is famous "spiral_Nc10_train.mat" and "spiral_Nc10_train.mat". "spiral_Nc10_train.mat" ...

0 answers

Widrow Nguyen MATLAB implementation

I tried to implement the Widrow - Nguyen weight initialization on MATLAB 2014a. to compare its performance against HARD RANDOM weight init technique. a = -1; b = 1; % WIDROW weights for Layer Input ...

2 answers

Delete zero string in array using matlab

I having a problem in deleting zero string, so i have a code that generates a string array: a =['29.74473' ' 0' '42.56682' '75.38116' '52.79034' ' 0' '61.77224' '16.23368' ...

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

error in matlab gui when trying to receive data from serial port “Subscripted assignment dimension mismatch”

I am trying to receive data from serial port and trying to plot the results but i am getting error as "Subscripted assignment dimension mismatch" code:- clear all; s = serial('COM2'); ...

1 answers | 1 hour ago by dcmotor on Stack Overflow stackoverflow.com
1 answer

bar3 showing only top surface, when using log scale

When running hBar = bar3(rand(6,8)); %// set(gca,'Zscale','log') % Problem when using log scale for k = 1:length(hBar) zdata = hBar(k).ZData; hBar(k).CData = zdata; hBar(k).FaceColor ...

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

Attaching custom data (string tag) to a MATLAB cfit object

I have a code where cfit objects are passed back and forth between functions\classes and I would like to have a "tag" that contains some information about my fit (i.e. its name), such that I ...

1 answer

Fast way to find the neighboor of pixel

I am programming for task that finds the neighbor of a given pixel x in image Dthat can formula as: The formula shown pixels y which satisfy the distance to pixel x is 1, then they are neighbor of ...

0 answers

A Bug in MATLAB in the simulink serial acquisition block in MATLAB [Solved]

I just wanted to share my way to solve a bug in Simulink (in Matlab v2010a and the same pause instruction which is the cause of the problem found in MATLAB2014a as well), maybe it can be useful to ...

0 answers

MATLAB crashes when executing mex but work well in debugging mode

When I executed a m-file which calls my gensm.mexw64, MATLAB crashed. However when I run the program in debugging mode, nothing happened. The code is void mexFunction(int nlhs, mxArray *plhs[], int ...

1 answer

Intersection of segment with polygon

aI have to create a function on MATLAB that performs the following task: Input: p polygon in the form p = [x1,y1; x2,y2; x3,y3; x4,y4...] s struct with the segment from A to B s = ...

0 answers

how to generate an image in the format of the mnist database?

I need to make a handwritten image to be tested with a neural network in Matlab. When I see the data contained in the training images from the MNIST I see that it is an array of different gray scales ...

0 answers

GMM in MATLAB gives different results for the same file

I construct a Gaussian Mixture Model in Matlab with a dataset through the function: model = gmdistribution.fit(data,M,'Replicates',5); with M number og gaussian component set to 3. I test new data ...

1 answer

Is there a bidirectional map in matlab?

Is there a bidirectional map data structure in matlab that is more efficient than using containers.Map's keys and values in an opposite direction? Also what is the most efficient way to use ordinary ...

2 answers

Transform a matrix 18x6692 to a matrix 1x120450 matlab

i have a char matrix (in matlab) 18x6692 and i want this to be a matrix with 1 row and 6692x18=120450 column. I'm not able to do this, can you help me? I also tried with a smaller matrix: from 2x4 to ...

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

Find number of consecutive ones in binary array

I want to find the lengths of all series of ones and zeros in a logical array in MATLAB. This is what I did: A = logical([0 0 0 1 1 1 1 0 1 1 0 0 0 0 0 0 1 1 1 1 1]); %// Find series of ones: csA = ...

0 answers

Find intersection points between a segment and a convex polygon

I'm trying to build a function in MATLAB, in which you input a segment (defined by two points) and a polygon (4-sides) by indicating on an array its vertices. I have the following code: function ...

2 answers

MATLAB: Plot random signal

My task is to plot a completely random signal. This is my progress so far: sig_length = 200; % this task is part of a three plot figure so ignore the subplot part subplot(2,2,1) hold on sig = ...

1 answer

Can we read a smoking.mat (dataset) in C-language?

The reason i want to read it in C is: i want to create a mnrfit.c file/function in replacement of mnrfit.m To see "smoking.mat", it is under the Matlab's installation directory: C:\Program ...

1 answers | 5 hours ago by Malik Asif Comsats on Stack Overflow stackoverflow.com
0 answers

How to plot RS chart using Matlab

I am working with some video data and I expected to see some self similarity when plotting the RS chart, instead I got zigzagy lines. I would like some of you to check my code segment & tell me if ...

2 answers

Matlab: getting GUI handle value from a callback function when calling by another function

I am new to GUI programming for Matlab, so my question relates to that. Let's say that I create a GUI with GUIDE. In the creation function MyGUI_OpeningFcn(hObject, eventdata, handles, varargin) ...

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

Creating indexed 'groups' in MATLAB

I have a data of size 1000 * 500 I want to put the data into 100 groups by partitioning the rows into sizes of 10 I want to do something like: for i = 1 : 100 %i = group Group[i] = data(10*i : ...

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

how to control aurdino through matlab simulink?

Recently i am working on final year project.Now i am stucked in to point that how to control aurdino through matlab simulink? My project explanation is below I have excel sheet after procession of ...

0 answers

Knn classification for OCR

I have implemented the ocr with example matlab code it has success but i have added the knn algorithm to it it is getting error above is the code which i got the output This is the code of OCR which ...

1 answer

Improve naive gauss elimination, when zero elements are known

I wrote naive gauss elimination without pivoting: function [x] = NaiveGaussianElimination(A, b) N = length(b); x = zeros(N,1); mulDivOp = 0; subAddOp = 0; for column=1:(N-1) ...

1 answers | 6 hours ago by Lempek on Stack Overflow stackoverflow.com
1 answer

MATLAB - Plot multiple surface fits in one figure

I have 3 sets of 3D co-ordinates and I have fitted planes to each set. Now, I want to plot all the data points and the 3 planes in one figure. So far, I have the following function: function ...

0 answers

Asynchronous Machine SI Units variables

What are SM.* variables inside the simulink Asynchronous Machine subsystem block? Where I can see their description?

3 answers

Can't get function to work

I am unable to write a function to generate a matrix. I keep on getting the error "Not enough input arguments" when I try to run the following: function B=generate_matrix(n) B=zeros(n,n); ...

3 answers | 7 hours ago by migs on Stack Overflow stackoverflow.com
0 answers

Matlab finding root of cubic with high precision

So I recently have been assigned a project to calculate the roots of a cubic polynomial. However the issue is that the roots could be very big, but also extremely small. I've been trying to use ...

15 30 50 per page
1 2 3