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

oltre 6 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)

oltre 6 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 ...

oltre 6 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)...

oltre 6 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];

oltre 6 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...

oltre 6 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 ...

oltre 6 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 ...

oltre 6 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));

oltre 6 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...

oltre 6 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...

oltre 6 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...

oltre 6 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

oltre 6 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])

oltre 6 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 ...

oltre 6 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 ...

oltre 6 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);

oltre 6 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) =...

oltre 6 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...

oltre 6 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...

oltre 6 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

oltre 6 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...

oltre 6 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...

oltre 6 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...

oltre 6 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...

oltre 6 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...

oltre 6 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 ...

oltre 6 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,...

oltre 6 anni fa | 0

| accettato