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

8년 초과 전 | 0

| 수락됨

답변 있음
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)

8년 초과 전 | 0

답변 있음
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 ...

8년 초과 전 | 0

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

8년 초과 전 | 0

| 수락됨

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

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 1

| 수락됨

답변 있음
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 ...

8년 초과 전 | 0

답변 있음
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 ...

8년 초과 전 | 0

답변 있음
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));

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 3

| 수락됨

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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

8년 초과 전 | 0

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

8년 초과 전 | 0

답변 있음
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 ...

8년 초과 전 | 0

답변 있음
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 ...

8년 초과 전 | 0

| 수락됨

답변 있음
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);

8년 초과 전 | 0

| 수락됨

답변 있음
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) =...

8년 초과 전 | 1

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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

8년 초과 전 | 1

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

답변 있음
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...

8년 초과 전 | 0

답변 있음
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...

8년 초과 전 | 0

| 수락됨

답변 있음
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...

8년 초과 전 | 0

답변 있음
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 ...

8년 초과 전 | 0

| 수락됨

답변 있음
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,...

8년 초과 전 | 0

| 수락됨