Answered
Axes label start at specific point with custom labels
plot(rand(10,1)) xlabel('TADA') hLabel = get(gca,'XLabel'); currPos = get(hLabel, 'Position'); newPos = currPos + ...

8 years ago | 0

| accepted

Answered
intersection of multiple arrays
A=[1,2,3,4]; B=[1,4,5,6,7]; C=[1,5,8,9,10,11]; M = {A,B,C}; N = {[B C], [A C], [A B]}; CommonElements = unique(...

8 years ago | 0

Answered
Is there a faster alternative for find() operation?
If you want to improve your code, first vectorize it and avoid using loops. <https://www.mathworks.com/help/matlab/matlab_pro...

8 years ago | 0

Answered
how to calculate monthly averages from daily averages of MODIS Data?
If you are using newer version of Matlab(2016 or later), use |timetable| <https://www.mathworks.com/help/matlab/ref/timetabl...

8 years ago | 0

Answered
repeating numbers in an array
unique(your_array) <https://www.mathworks.com/help/matlab/ref/unique.html>

8 years ago | 0

| accepted

Answered
how to label both side on y axis?
For older versions |plotyy| should work. <https://www.mathworks.com/help/matlab/ref/plotyy.html>

8 years ago | 0

| accepted

Answered
Subplots Saveas Function Problem
g1 = graph(X1,Y1,Y2,Y3,Y4); saveas(g1,'filename.png')

8 years ago | 0

Answered
Converting polar coordinates to X,Y,Z for 3d plots
Because you have |ones(360)| in all three cases. Change it to |zeros(360)| and all the circles will be oriented at the origin.

8 years ago | 0

Answered
How can i exchange values between 2 functions (2 different buttons on a GUI) ?
It has already been answered here. <https://www.mathworks.com/matlabcentral/answers/251558-how-to-pass-value-of-a-variable-fr...

8 years ago | 0

| accepted

Answered
How to create multiple excel sheets in Matlab?
sheet1 = 1; writetable(Tab1,filename,'sheet',sheet1 ,'Range','A1') sheet2 = 2; writetable(Tab2,filename,'sheet',s...

8 years ago | 1

Answered
how to take a mean of specific rows
your_variable_mean_1 = mean(your_variable([1 13 25 37],:),1) %row-wise mean your_variable_mean_2 = mean(your_variable([2 14...

8 years ago | 0

Answered
Compare data in excel to folder location mat files.
[~,filenames,~]=xlsread('your_excel_file.xls'); folderInfo = dir('your_folder/*.mat'); folder_filenames = {folderInfo.na...

8 years ago | 0

Answered
How can i have a integer value?
amount = [2010 12060 16080 2010 10050 1005]; val =[0.025 0.015 0.025 0.025 0.020 0.015]; money = amount .* val; summ...

8 years ago | 0

Answered
How to Increment matrix
start_t = datenum('15:25:01','HH:MM:SS') step_t = datenum('15:25:31','HH:MM:SS')-datenum('15:25:01','HH:MM:SS'); end_t =...

8 years ago | 2

| accepted

Answered
Code some excel formulas in Matlab, in a smart way
x = 1:5; y = 6:10; xy = arrayfun(@(a,b) [x(1):a;y(1):b],x,y,'UniformOutput',false); q = cellfun(@(c) sum([0.5 ones(si...

8 years ago | 0

Answered
Concantenate Horizontally Matrices from Two Different Cell Arrays
Assuming your matrix dimensions are consistent, cellfun(@(a,b) [a;b],A,B,'UniformOutput',false)

8 years ago | 1

Answered
Replace an element in a cell array when a certain value only occurs once?
a = rand(20,1); x = {a,a,a,a,1,a,a,a,1,a,a,a}; sizes_x = cellfun(@(e) (size(e,1)*size(e,2))==1,x,'UniformOutput',false) ...

8 years ago | 0

Answered
How to represent multiple lines (20+) in legend?
Check this out <https://blogs.mathworks.com/pick/2011/02/11/create-multi-column-plot-legends/>

8 years ago | 0

| accepted

Answered
How to make matlab start by opening a folder than doesn't have a matlab folder as a root
You can change it under preferences. <https://de.mathworks.com/help/matlab/matlab_env/matlab-startup-folder.html>

8 years ago | 1

Answered
random number generation to add and subtract
numsum = -1; while numsum<0 || numsum>9 a = randi([1 9]); b = randi([-9 9],3,1); while b(1)==0 || b(2...

8 years ago | 1

Answered
Combine the results of each iteration into an array
I don't understand what your actual intention of having two loops but if you just want to add |m| and |n| to the existing values...

8 years ago | 0

| accepted

Answered
plotting values with duration format
Because you have a jump from |06:23:00| to |07:00:00|. Add the following line to your code and set the |xticks| explicitly. ...

8 years ago | 0

| accepted

Answered
How to extract the diagonal of a given matrix?
A(sub2ind(size(A),1:size(A,1),1:size(A,2)))

8 years ago | 3

| accepted

Answered
how to convert an ascii file into a .xls file in matlab ?
filename_in = 'your_input_file.dat'; delim = ' '; %your delimiter data = dlmread(filename_in,'delimiter',delim); fil...

8 years ago | 0

Answered
Replot a matlab.graphics.chart
|plot1| is the axis handle. _"re-plotting"_ means plotting on the same figure window with the new data. for iCount = 1:5 ...

8 years ago | 0

Answered
How to Create a 5x5 matrix whose rows are (1:5)?
A = repmat(1:5,5,1); or in general, N = 5; A = repmat(1:N,N,1)

8 years ago | 1

Answered
how to update the step size in my code ?
Something like this?? A=[25 30 47 58;11 25 87 98;77 44 85 23;97 48 25 14]; B=[1 5;5 1;7 7;9 8]; C=[74 2 11 7;5 6 9 9]...

8 years ago | 1

Answered
How to create a matrix of size N×N that has ones in the border and zeros inside?
function A = oneZeroMatrix(N) A = zeros(N); A([1 end],:)=1; A(:,[1 end])=1; end % and then N = 5; ...

8 years ago | 1

| accepted

Load more