Réponse apportée
how can I read huge asc files with textread?
Get file names and apply ext_date = datetime(extractBetween(<your file name(here ppt_19990101_asc)>, '_', '_'), 'Format', 'yyy...

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 1

| A accepté

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

plus de 6 ans il y a | 1

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

plus de 6 ans il y a | 2

Réponse apportée
Rename Excel column heading to MATLAB
data = readtable('<your xlsx file name>'); % read your file as table data.Properties.VariableNames = {'Var1', 'Var2', ..... ...

plus de 6 ans il y a | 1

| A accepté

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

plus de 6 ans il y a | 1

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

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
problem in creating animation plot 2D
Put figure out side of the for loops figure('color','white');

plus de 6 ans il y a | 1

| A accepté

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

plus de 6 ans il y a | 0

Réponse apportée
How to parcours data?
You can use ismember function to find as you require

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 1

| A accepté

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 0

Réponse apportée
write text in file
txt = 'text message'; fid = fopen('file.txt', 'wt'); fprintf(fid,'%s', txt); fclose(fid);

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Sorting matrix while removing zero values and keeping track of index at the same time.
totalAmplitude(ind == 0)=[];

plus de 6 ans il y a | 0

Réponse apportée
Eliminate the table inside a cell, if any NaN exists inside that table.
Cnew = NewC2LatLon(~cellfun(@(x)any(isnan(x.precip)), NewC2LatLon));

plus de 6 ans il y a | 1

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

plus de 6 ans il y a | 0

Réponse apportée
How can I find Overshoot and Undershoot from graphic?
disp(fdev(:, 1:2)); %display values of fdev of columns 1, 2 in command window

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
matlab function block querry
Use command exit or quit

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 1

Réponse apportée
Random Number generation with defined decimal points
num = ( 2.5 - 1.4)*rand + 1.4;

plus de 6 ans il y a | 0

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

plus de 6 ans il y a | 0

| A accepté

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

plus de 6 ans il y a | 1

| A accepté

Charger plus