Respondida
cannot create mat file.
You should do this: filename = 's2.wav'; [y, Fs] = audioread(filename); save('s2.mat','y');

más de 9 años hace | 0

| aceptada

Respondida
I have a project concerning a grayscale picture
The image has the salt and pepper noise. You can remove it using medfilt2 (Image Processing Toolbox)

más de 9 años hace | 0

Respondida
Keep getting error: Maximum number of function evaluations has been exceeded - increase MaxFunEvals option. Current function value: NaN
Not completely sure what the problem is but you can remove the NaN entries from the array. Lets say your array of size 100x1 is ...

más de 9 años hace | 0

Respondida
How to unfold (spread) vector?
You can use interp1. Try this: newRange = linspace(1, numel(corr), numel(env_energy)); newCorr = interp1(1:numel(corr)...

más de 9 años hace | 0

| aceptada

Respondida
How to define a range to iterate with gaps in between?
Try this: range = [1:10, 15:20, 25:30];

más de 9 años hace | 0

| aceptada

Respondida
How to get the pathname and filename of some files that I have chosen?
You can do this: [filename, pathname] = uigetfile(type, 'Select Multiple Files','MultiSelect','on'); numberOfFiles = l...

más de 9 años hace | 1

| aceptada

Respondida
for loop and break!!!
Break will work for the loop it is in, so the second for loop. It is always good to run an example and check: for i = 1:10 ...

más de 9 años hace | 0

Respondida
Subplot displacement against time
You should do this: figure(1); subplot(2,1,1); Change figure(2) to figure(1) and change subplot(2,2,1) to ...

más de 9 años hace | 0

Respondida
Hello everyone! I need some help regarding creating a dynamic/flexible array/matrix in matlab?
Use a cell array. d1{1,h} = find(C1(:,:,h));

más de 9 años hace | 0

| aceptada

Respondida
How can i collect number without using eval function ?
You can try something like this: in = input('Please enter a number:','s'); s = strsplit(in,'+'); result = sum(str2...

más de 9 años hace | 3

| aceptada

Respondida
How can I change/replace values in second column according to conditions?
Try this: T = A(:,2); a = [1,2,3,4,13,14,15,16]; b = [5,6,7,8,17,18,19,20]; c = [9,10,11,12,21,22,23,24]; T(ismember...

más de 9 años hace | 0

| aceptada

Respondida
erorr in for loop
.^ is for element wise operation. Use this: w=0:0.02:5; for i=1:length(w) a(i)=w(i)^4-12*(w(i)^2); b(i)=w(i)^8...

más de 9 años hace | 0

| aceptada

Respondida
Image processing: moving window correlation between two image
Try this: correlation_coefficient = corr2(A,B); % A and B are sub-images of the original images

más de 9 años hace | 0

Respondida
How can i collect number without using eval function ?
You mean something like this: Number=input('Enter Number please:','s'); eval(['result = ' Number])

más de 9 años hace | 0

Respondida
Please... I want to import several excel files at once. used for_fuction
You can try this: oldfolder = cd(source_dir); xlfiles = dir('*.xlsx'); nfiles = length(xlfiles); for i = 1:nfiles ...

más de 9 años hace | 0

Respondida
passing character strings into functions
You can use a cell array: picturnames = {'IMG_1562' 'IMG_1563' 'IMG_1564' 'IMG_1565'}; Pass picturnames to the function ...

más de 9 años hace | 0

| aceptada

Respondida
If I have a function with 1 input producing 3 outputs; ran a small program loop to produce multiple outputs; how would I print out the input and 3 values in that order for the first 12 outputs.
You mean something like this? fprintf('Input: %d, Output1: %d, Output2: %d, Output3: %d\n', inp, out1, out2, out3);

más de 9 años hace | 0

| aceptada

Respondida
how to use matrix of three variables
Not sure what you want but something like this: final3DMatrix = zeros(77,77,10); for i = 1:10 final3DMatrix(:,:,i) =...

más de 9 años hace | 1

Respondida
If statement (in master GUI) to call slave GUI and then have the slave edit value in master and program continue in master.
Why do you want a separate GUI for that? You can just use a questdlg for that. Try this: val = questdlg('Are you sure it ha...

más de 9 años hace | 0

| aceptada

Respondida
how can i do this operation?
As you can see M and X are of different sizes, you cannot perform a subtraction operation on them. Maybe you can do this: M...

más de 9 años hace | 0

| aceptada

Respondida
How can I get dynamic naming variables? So in a loop i need variables with names A1,A2,A3...... logic?
You can use eval. Try this: for i = 1:10 eval(['A' num2str(i) ' = i;']); end

más de 9 años hace | 1

Respondida
Getting a variable from an Edit box, using a push button.
It will not go to your workspace directly. To save the value to the workspace do this: age = str2double(get(handles.AgeEdit...

más de 9 años hace | 0

| aceptada

Respondida
When many figure windows present, the pause command doesn't work
I think it takes 20+ seconds because you first close all the open figures while the tic has already started. It computes all the...

más de 9 años hace | 0

Respondida
Reading audio file using GUI pushbutton and saving them to a folder
You can start with this and then continue: [filename, pathname] = uigetfile('*.wav', 'Select a wave file','MultiSelect','on...

más de 9 años hace | 0

Respondida
How to convert a column date wich contains NaN?
You should remove the NaN entries first. DO this: T(isnan(T)) = []; D= datenum(num2str(T),'yyyymmddHHMM'); C= datestr...

más de 9 años hace | 0

| aceptada

Respondida
I want to display the results shown in command window by clicking push button.
You should always share some code with questions like these. Lets say the handle to the textbox is 'display_text' and the output...

más de 9 años hace | 0

Respondida
how to do this operation to calculate a new matrix ?
Try this: N = 10; m = size(A,1); % Pre-allocate the F_Complete matrix F_Complete = zeros(m, N) for i = 1:m ...

más de 9 años hace | 0

| aceptada

Respondida
How can I filter a date column so it just considers every 5 minutes observations for each day?
You can use the mod operator. Lets say the data vector is x and it needs to rearranged in C. Try the following: C = cell(1,...

más de 9 años hace | 0

| aceptada