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

quasi 8 anni fa | 0

| accettato

Risposto
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)

quasi 8 anni fa | 0

Risposto
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 ...

quasi 8 anni fa | 0

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

quasi 8 anni fa | 0

| accettato

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

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 1

| accettato

Risposto
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 ...

quasi 8 anni fa | 0

Risposto
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 ...

quasi 8 anni fa | 0

Risposto
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));

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 3

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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

quasi 8 anni fa | 0

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

quasi 8 anni fa | 0

Risposto
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 ...

quasi 8 anni fa | 0

Risposto
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 ...

quasi 8 anni fa | 0

| accettato

Risposto
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);

quasi 8 anni fa | 0

| accettato

Risposto
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) =...

quasi 8 anni fa | 1

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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

quasi 8 anni fa | 1

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

Risposto
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...

quasi 8 anni fa | 0

Risposto
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...

quasi 8 anni fa | 0

| accettato

Risposto
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...

quasi 8 anni fa | 0

Risposto
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 ...

quasi 8 anni fa | 0

| accettato

Risposto
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,...

quasi 8 anni fa | 0

| accettato