답변 있음
rename files from subfolders
Get all files structure to one variable cd <your directory> d = dir('**/*.bmp') Apply loop to get every file to structure fi...

대략 4년 전 | 0

| 수락됨

답변 있음
Error using == Number of array dimensions must match for binary array op.
You are comparing character array with image matrix that is why you got error if(a==imageArray) disp('yes'); end % ...

대략 4년 전 | 0

답변 있음
I want to create a code that tells me the location of the number I entered whenever the function varies from trial to trial.
Am I correct? number = input('Please enter a number'); % input number matrix(number) = []; % delete corresponding number p...

대략 4년 전 | 0

| 수락됨

답변 있음
I'm doing an engineering practice report and I need to remove arbitrary data from 2 arrays used in a plot.
Suppose data is like x= -2:0.1:2; % x axis y = 1:41; % ydata z = plot(x, y); % Plot x,y to variable z x_data_ls_0 =...

대략 4년 전 | 0

| 수락됨

답변 있음
Multiply number of days for each month to data column
for i = 1:numel(test) test{i}.precip = test{i}.precip.*eomday(year(test{i}.date),month(test{i}.date)); end

대략 4년 전 | 1

| 수락됨

답변 있음
Calculating grades in a while loop
grade_A = sum(score>=90); grade_B = sum(score>=80 & score<90); For more details on loops and conditionings read https://in.m...

대략 4년 전 | 1

답변 있음
Sub-plots properties
subplot(1, 2,1), plot(1:10); subplot(1, 2,2), plot(2*1:10); ax = gca; % using gca fields you can do ax.Children.Marker = ...

대략 4년 전 | 2

답변 있음
Rename Excel column heading to MATLAB
data = readtable('<your xlsx file name>'); % read your file as table data.Properties.VariableNames = {'Var1', 'Var2', ..... ...

대략 4년 전 | 1

| 수락됨

답변 있음
Unrecognized function or variable
val=input('Centigrade: '); When you give w MATLAB thinks as its a variable not string, if you give "w" in double quotes(not sin...

대략 4년 전 | 1

답변 있음
Rename all image files (e.g. jpg) in a folder according to the file modification date
Get the all jpg files d = dir([path, '\*.jpg']); Apply loop for each image file of the directory and get the filename file...

대략 4년 전 | 1

| 수락됨

답변 있음
problem in creating animation plot 2D
Put figure out side of the for loops figure('color','white');

대략 4년 전 | 1

| 수락됨

답변 있음
matrix multiply by array xi=xj
x = 1:4; eij= [0 1 0 1;1 0 1 1;0 1 0 1;1 1 1 0]; tmp =0; for i = 1:4 for j = 1:4 tmp =tmp + eij(i, j)*(x(j)-x...

대략 4년 전 | 0

답변 있음
How to parcours data?
You can use ismember function to find as you require

대략 4년 전 | 0

답변 있음
Replace missing value of cell array with NaN
ind = cellfun(@(x) (x<-1),presglb,'UniformOutput',false); for ii =1 :length(presglb) presglb{ii}(ind{ii}) = nan; end

대략 4년 전 | 1

| 수락됨

답변 있음
How to operate on 2d matrices in a 3D array?
data = randi([1,10], 3,3,4); % your matrix with n = 4 data_det = arrayfun(@(i)det(data(:,:,i)), 1:size(data,3)); data_t...

대략 4년 전 | 0

| 수락됨

답변 있음
Export multiple tables in loop
Usually you should do as var_name = ['f5_', str2num(i)]; writetable(eval(var_name), 'FF5_results.xlsx','Sheet',i); But Vari...

대략 4년 전 | 0

답변 있음
write text in file
txt = 'text message'; fid = fopen('file.txt', 'wt'); fprintf(fid,'%s', txt); fclose(fid);

대략 4년 전 | 0

| 수락됨

답변 있음
Sorting matrix while removing zero values and keeping track of index at the same time.
totalAmplitude(ind == 0)=[];

대략 4년 전 | 0

답변 있음
Eliminate the table inside a cell, if any NaN exists inside that table.
Cnew = NewC2LatLon(~cellfun(@(x)any(isnan(x.precip)), NewC2LatLon));

대략 4년 전 | 1

답변 있음
row mean vector of a image
row_mean = mean(I, 2); % I is your image for more details read https://in.mathworks.com/help/matlab/ref/mean.html

대략 4년 전 | 0

답변 있음
How can I find Overshoot and Undershoot from graphic?
disp(fdev(:, 1:2)); %display values of fdev of columns 1, 2 in command window

대략 4년 전 | 0

답변 있음
How to assign a variable name to a cell in a for loop?
definedsubjects = num2cell(rand(4,2)); for ii = 1:size(definedsubjects, 2) col = definedsubjects(:, ii); end

대략 4년 전 | 0

| 수락됨

답변 있음
matlab function block querry
Use command exit or quit

대략 4년 전 | 0

답변 있음
Change random values in the matrix of 234*10000
X= rand(10); % total locations, 10*10 = 100; loc = randperm(numel(X), 1); % out of 100 locations i pick one random locati...

대략 4년 전 | 0

답변 있음
How to combine rows with some identical values in a table
lat = [47.5, 45.5, 46.5, 46.6, 47.8]'; lon = [-63.5, -61.5, -62.5, -62.4, -63.6]'; pts_positions = table(lat, lon); % Min and...

대략 4년 전 | 0

| 수락됨

답변 있음
How can i make array with strings ?
In string related operations use cell array data type as D = cell(100, 200); for i =1:100 for j =1:200 D{i, j} =...

대략 4년 전 | 1

답변 있음
Random Number generation with defined decimal points
num = ( 2.5 - 1.4)*rand + 1.4;

대략 4년 전 | 0

답변 있음
Multiple tables from one table
It is not recommended practive to put your tables as array type, highly error prone and variable name changes. Your should assig...

대략 4년 전 | 0

| 수락됨

답변 있음
How to find first two largest peaks with sample location
d = rand(100,1); % assumed data [vals,loc] = maxk(d,2); % first two peaks(mnaximum values) sample values and locations p...

대략 4년 전 | 1

| 수락됨

답변 있음
Readtable, problems reading identically structured data files
If you are not specific on to use only table try this f1 = fopen('File1.txt', 'r'); f2 = fopen('File2.txt', 'r'); % read file...

대략 4년 전 | 0

| 수락됨

더 보기