Answered
How to calculate width and height of histogram
I'm not sure I understand that information is returned by hist() X = randn(100,1); [N,bincntr] = hist(X); Now you kno...

10 years ago | 0

| accepted

Answered
This code for ant colony optimisation is showing (??? Undefined function or method 'ACO' for input arguments of type 'char'.) error, how do I correct it?
I think you have several issues in the excerpt you posted above, I have reformatted a bit. Download the attached aco.m file and ...

10 years ago | 0

Answered
implementation of mean shift filtering for 1 dimensional array
You can just do x = detrend(testdata,0); Now compare: subplot(211) plot(testdata) subplot(212) plot(x)

10 years ago | 0

Answered
How to use integration function?
int() is for symbolic function. Use integral with a function handle. Or use one of the other numerical routines, trapz(), cumtra...

10 years ago | 0

Answered
plotting tan(x) - basic student's question
tan(x) is periodic with period pi and "blows up" at odd multiples of pi/2 so why not just plot one period? dx = 0.01; x ...

10 years ago | 1

Answered
svd - what are the principal components?
To compute the principal components using the SVD, I think you first want to center the data and compute something at least prop...

10 years ago | 0

Answered
Function 'subsindex' is not defined for values of class 'tf'.
Giacomo, likely in your program you make the mistake of creating a variable called step. Then you try to index that variable ...

10 years ago | 0

Answered
unable to input using filename (dxf)
If you want this to be a string, you need to enclose it in single quotest filename = input('Type the name of the dxf-file:'...

10 years ago | 0

Answered
How to write a function that returns a graph?
You can simply not have an output argument function myplot(x,y) plot(x,y) end That's one way

11 years ago | 2

Answered
I have Matlab R2011a version. I want to convert .slx file to .mdl file. Please give me some suggestion for the conversion
If somebody has given you a .slx modeld from a more recent version of Simulink, ask them to simply save it in the earlier versio...

11 years ago | 0

| accepted

Answered
Help with a scatter3 plot
Why not use quiver3() if you want vectors x =[ -1.0393 0.0844 1.3133 0.1248 1.4003 -0.6345 1.40...

11 years ago | 0

| accepted

Answered
Unique random number (between 1 and 40)
Why not just use randperm() x = randperm(40); If you want to randomly select a subset K = 10; x = randperm(40,K)...

11 years ago | 0

| accepted

Answered
How to a creat a sweeping radius, like that of a radar.
It's easy enough to simulate that, but are you just interested in something for visual effect? In other words, not tied to any u...

11 years ago | 0

Answered
how can i plot graph one above another with same X-axis and changing Y-axis(attaching a rough model i need)
X = randn(100,3); X(:,2) = X(:,2)+10; X(:,3) = X(:,3)+20; subplot(311) plot(X(:,1)); ax1 = gca; set(ax1,'xtick',[]); se...

11 years ago | 1

Answered
How can avoid the error: Error using fclose Invalid file identifier. Use fopen to generate a valid file identifier. Error in open837 (line 4) fclose(fid);
What is fid = fopen('18oct2013-121730.837', 'r'); returning, a -1? You can use [fid,msg] = fopen('18oct2013-1...

11 years ago | 1

Answered
I'm trying to produce a sampled piano note and I keep getting the error "Index exceeds matrix dimensions." I'm not sure where i've gone wrong :/
Without commenting on your code, the following should fix your problem for i = 1:length(Frequencies) Signal = Sign...

11 years ago | 0

Answered
how to make a function - keep getting errors
How is your function supposed to know what LE() and ME() are for starters? Or FH()? You do not provide those arrays as input ...

11 years ago | 0

Answered
eliminating rows in a file (rookie question)
Using your example A = [123 2.334 645 3.445 1234 4.246 2450 5.332 2901 6.092 3287 6.345 3991 7.764...

11 years ago | 0

Answered
Omitting negative pixels in the image representation
Depending on your data and application, you can just take the absolute value. If that doesn't work you can set all the negative ...

11 years ago | 0

Answered
i dont know that warning massage . Please help me as soon as posible
It means that the function parfind.m has an output argument in its function signature called parpos and that is not being comput...

11 years ago | 0

Answered
Problem with FFT analysis of longer data sets
One thing that immediately comes to mind is that if you know the frequency of the sinewave, you should always pad the fft() so t...

11 years ago | 1

Answered
how to execute the algorithmic operations like summation, cross etc. in matlab?
You can use dot() to compute the inner product of two vectors. norm( ) to compute the norm, since the norm induced by the inn...

11 years ago | 0

Answered
Errors when trying to computer DTFT?
You're not assigning X anything in your function except zeros Minimally, in your for loop, you should be doing something like...

11 years ago | 0

Answered
Errors when trying to computer DTFT?
you misspelled length() There is no MATLAB function, lentght()

11 years ago | 0

Answered
How to enter the R-square fit formula in the m-file?
Residual sum of squares residsumsq = norm(y-yhat,2)^2; Total sum of squares tsumsq = norm(y-mean(y),2)^2; R2 =...

11 years ago | 0

| accepted

Answered
How do I reshape a dataset?
When you say dataset, do you just mean a matrix? X = randn(288,35); Y = X.'; If the elements are all real-valued, ju...

11 years ago | 0

Answered
How to generate matrix using MATLAB ?
I'm sure there are many different ways: X = zeros(1,96); X(1:4) = 1; K = 0; for nn = 1:24 Y(nn,:) = circshift...

11 years ago | 0

Answered
i need help for string code
When you write a1 = 1; a2 = 2; You are creating two new variables with values 1 and 2. What about: vals = {'1...

11 years ago | 0

Answered
When Using the Discrete Wavelet transform using a Haar filter, i get negative values and the dynamic range goes up to well over 400
Hi Daniel, I surprised you say that the LL image contains negative values. That I don't observe (nor would I expect it) for your...

11 years ago | 0

| accepted

Answered
How to plot the spectrum of a high frequency sine wave of above 1GHz
Do you have the Signal Processing Toolbox: Fs = 4e9; t = 0:1/Fs:0.001-(1/Fs); x = cos(2*pi*1.5e9*t); [Pxx,F] = per...

11 years ago | 1

| accepted

Load more