Community Profile

##### Last seen: Today
372 total contributions since 2017

MATLAB enthusiastic

View all

Contributions in
View by

You no need to do program to find roots of the quadratic quation, MATLAB has built in command roots a=input('a=') b=input('b='...

2 hours ago | 0

How to extract data in excel file in matlab
data = readmatrix('2014-2015 KU Basketball.xlsx'); [val, ind] = max(data(:, 2)); game_num = data(ind, 1);

3 hours ago | 0

How to Access and Rename Doubles that are Stored in a Large Cell
You no need to rename every elecment(500x100 double) of the cell which leads much complications, you can perform your operation...

3 hours ago | 0

How to generate a fixed number of float numbers and their sum is a fixed float number?

15 hours ago | 0

How to copy columns in a matrix.
1) res = circshift(mat, [0 -1]); % mat assumed as your matrix 2) mat = [zeros(size(mat, 1),1), mat] % Append zeros as firs...

17 hours ago | 0

Solved

Find the index of elements in a string vector
In the vector of v, find the index of elements specified by a. v = ["Lion","Koara","Elephant","Snake","Dog","Cat","Camel"]; ...

17 hours ago

Rounding numbers below 0.7 to 0.7
efficiency_final(efficiency_final<0.7) = 0.7

1 day ago | 0

| accepted

Locating entered vector values
ind = find(ismember(x, a))

1 day ago | 0

| accepted

How to store corrcoef values?
If the size of the corrcoef is consistent through out the loop % row = should write the rows of the corrcoef result % col = s...

3 days ago | 0

I having error in fileID=fopen(filename). Anyone can help with it? thanks
That means your are trying to run function without giving input filename. You should run the function in script file or command ...

3 days ago | 0

Delete files with specific sizes
Get the directory files files = dir('your directory'); Apply loop and delete with your condition for ii = 1:length(files) ...

3 days ago | 1

| accepted

Problem creating video mp4 from animation.
VideoWriter % correct one you have give videowriter(not case sensitive)

3 days ago | 1

| accepted

Get file names and apply ext_date = datetime(extractBetween(<your file name(here ppt_19990101_asc)>, '_', '_'), 'Format', 'yyy...

3 days ago | 0

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

3 days ago | 0

| accepted

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 % ...

3 days ago | 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...

3 days ago | 0

| accepted

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 =...

3 days ago | 0

| accepted

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 days ago | 0

| accepted

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 days ago | 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 = ...

5 days ago | 1

Rename Excel column heading to MATLAB

5 days ago | 0

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

5 days ago | 0

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

5 days ago | 1

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

5 days ago | 1

| accepted

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

5 days ago | 0

How to parcours data?
You can use ismember function to find as you require

6 days ago | 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

6 days ago | 1

| accepted

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

6 days ago | 0

| accepted

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

6 days ago | 0