Answered
Plot netcdf map file with pcolor
s = pcolor(arrayLonFullDisk, arrayLatFullDisk,arrayTempFullDisk); shading interp colormap(jet);

4 years ago | 1

| accepted

Answered
Get every 4 values of a vector and change values
a = [1 1 0 0 1 1 1 1 0 1 0 1 1 0 0 0 0 0 0 0 1 1 0 0] ; b = [1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1] ; idx = bsxfun(@...

4 years ago | 0

Answered
Group repeated values in an array and mention the repeated value with position
a=[ 6 6 5 6 5 6 6] ; [c,ia,ib] = unique(a) ; for i = 1:length(c) fprintf('Group %d = %d\n',i,c(i...

4 years ago | 0

| accepted

Answered
How to make the sizes of all variable same in the loop.
% Demo data Game0 = rand(5,1) ; Game1 = rand(7,1) ; Game2 = rand(9,1) ; Game3 = rand(3,1) ; a = {Game0 Game1 Game2 Ga...

4 years ago | 0

| accepted

Answered
How to define a function in correct form and plot it out?
Element by element division is needed. ./ should be used. T = linspace(0,1000,10); u = @(k,T,h_,n,m) k*T.*log(exp(pi*h_*h_*n./...

4 years ago | 0

| accepted

Answered
Extract an arbitrary vector from a matrix
idx = 4:81 ; idy = 8:25 ; x = X(idx,idy) ; y = Y(idx,idy) ;

4 years ago | 0

| accepted

Answered
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
This error occurs when you try to save ore number of elements in LHS than it is initialized for. A = zeros(2) ; A(1,:) = ran...

4 years ago | 0

Answered
How to replace all but one value with zero
f=[49; 18; 48] ; f(f~=18) = 0 ; % repalce by value f=[49; 18; 48] iwant = zeros(size(f)) ; iwant(3) = f(3) ; % replace ...

4 years ago | 1

| accepted

Answered
smoothing of a 2d distribution
Read about interp2 and imresize.

4 years ago | 0

| accepted

Answered
how to get a contour plot for a matrix with imaginary values
You can plot either ral, imaginary or absolute of the value. contourf(1:1:10,1:1:6,real(pm1)); % to plot real part contourf...

4 years ago | 1

Answered
Index exceeds the number of array elements. Index must not exceed 1023. How to remove this error or how to limit this error?
Error is clear. You are trying to extract more number of elements than present from the array. Example: A = rand(5,1) ; % ...

4 years ago | 0

Answered
How to make plot of an equation?
You messed up with linspace and the defined function. E = -10:0.1:10 ; r1 = 0.4; h_ = 6.62607004*10^-34; Vf = 10^6; ...

4 years ago | 1

| accepted

Answered
How to predict new outputs on a trained Neural Net time series?
You need to export/ save the net i.e. weights into a function which the toolbox gives options. This saved function takes inputs ...

4 years ago | 0

Answered
works with dataset by searching for specific value
To find out NaN use isnan. A = [1 2 NaN 4 NaN 9] ; idx = isnan(A) Likewise to find out an array is empty read about isempty....

4 years ago | 0

Answered
Create a matrix of average Values from a Vector
The same implementation without loop: matrix = (vector+vector')/2 ; When you have used a loop, you need to initilaizethe matri...

4 years ago | 0

Answered
how do i deduce the function using linear regression for a set of x and y values?
clc clear all load x2.txt load y2.txt x=x2 ; y = log(y2) ; % Use polyfit p = polyfit(x,y,1) ; yCalc1 = polyval(p,x) ; ...

4 years ago | 1

Answered
How to convert 183*5 matrix data into column vector data
T = readtable('data.xlsx') ; T = table2array(T) ; T = T' ; T = T(:) ; plot(T)

4 years ago | 0

| accepted

Answered
random selection for .csvfile
csvFiles = dir('*.csv'); N = length(csvFiles) ; idx = randi(N,1) ; csvFile = csvFiles(idx).name ; T = readtable (csvFile);

4 years ago | 0

| accepted

Answered
How to create 15,24 25 26,33 34 35 36 37 in a triangle pattern?
https://in.mathworks.com/matlabcentral/answers/225558-how-to-create-a-1-12-123-1234-pattern-in-a-triangle https://in.mathworks...

4 years ago | 0

| accepted

Answered
Shifting least negative value to zero
Let x be your data. xnew = x-min(x) ; Als have a loon on the function rescale. https://in.mathworks.com/help/matlab/ref/resc...

4 years ago | 0

| accepted

Answered
Traingular mesh, face normals plotting
You can use the function facenormal. Read it here: https://in.mathworks.com/help/matlab/ref/triangulation.facenormal.html

4 years ago | 1

Answered
How to compile/save the data extracted/read from multiple excel files from each iteration of loop into a single file???
xlFiles = dir('*.xlsx'); N = length(xlFiles); Tmat = cell(N,1) ; for i = 1:N thisFile = xlFiles(i).name; T = rea...

4 years ago | 0

| accepted

Answered
Memory usage of a function
N = 100; A = rand(N, N); b = rand(N, 1); mem1 = A \ b ; mem2 = sparse(A) \ b ; whos mem1 mem2

4 years ago | 0

Answered
How to color a small squared or half squared zone of the plot?
B = [23 1865; 36 1865; 36 1890 ; 23 1890] ; patch(B(:,1),B(:,2),'b') ; hold on plot(p,t) ;

4 years ago | 0

| accepted

Answered
Passing one value at a time
A = rand(5,1) for i = 1:length(A) A(i) end

4 years ago | 0

Answered
EXAMPLE OF ALGORITHMIC/AUTOMATED TRADING MATLAB CODE
https://in.mathworks.com/discovery/algorithmic-trading.html https://in.mathworks.com/discovery/automated-trading.html

4 years ago | 0

Answered
I have a matrix P having 100 rows and 2001 columns. can you please help me to make a probability distribution curve of columns and mean line of rows.
x = rand(100,2001) ; % dummy data fro demo mx = mean(x) ; % mean of row elements h = histfit(mx,100,'kernel')

4 years ago | 1

Answered
how to change matlab answers type?
Read about format. https://in.mathworks.com/help/matlab/matlab_env/format-output.html Try format short

4 years ago | 1

Answered
total marks and percentage in marksheet of excelfile
T = readtable(myexcelfile) ; marks = table2array(T(:,3:6)) ; total_marks = sum(marks)/400 ; % four subjects each 100 marks ...

4 years ago | 0

Load more