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

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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)

plus de 9 ans il y a | 0

Réponse apportée
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 ...

plus de 9 ans il y a | 0

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

plus de 9 ans il y a | 0

| A accepté

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

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
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 ...

plus de 9 ans il y a | 0

Réponse apportée
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 ...

plus de 9 ans il y a | 0

Réponse apportée
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));

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 3

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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

plus de 9 ans il y a | 0

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

plus de 9 ans il y a | 0

Réponse apportée
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 ...

plus de 9 ans il y a | 0

Réponse apportée
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 ...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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);

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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) =...

plus de 9 ans il y a | 1

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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

plus de 9 ans il y a | 1

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 9 ans il y a | 0

Réponse apportée
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 ...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
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,...

plus de 9 ans il y a | 0

| A accepté