Answered
Swap between 3 Matrix
Save the below into a function and run in command line. function [n1,n2,n3] = swap(n1,n2,n3) ; temp = n2 ; n2 = n1 ; n1 = ...

6 years ago | 1

Answered
a function that draws a plot and uses an input for the title of the plot
figurenumber = 4 ; title_name = ['Figure',num2str(figurenumber),'.Temperatures'] ; title(title_name)

6 years ago | 1

| accepted

Answered
Convert Matrix to ArcGIS raster
It depends whether your data is structured or unstructured. Based on the data, the folloiwng is the procedure. Let A be your (x,...

6 years ago | 0

| accepted

Answered
finding troughs in signal
Read about findpeaks.

6 years ago | 0

Answered
i want to calculate the mean of all the images that are present in my folder. I have written the code for calculating the mean of 1 image . I want the mean of all the images that are present in my folder
imgFiles = dir('*.jpg') ; % get ll images in the folder N = length(imgFiles) ; % Total number of images % loop for each ...

6 years ago | 0

| accepted

Answered
Plotting a graph row by row from a table
Pick the data into a matrix from table. You can either use table2array, table2cell. Let A be your m*n matrix. plot(A') legend...

6 years ago | 0

Answered
How do i combine the stiffness matrix for a rectangular mesh with 100 elements.?
Refer: https://in.mathworks.com/matlabcentral/fileexchange/32029-plate-bending https://in.mathworks.com/matlabcentral/fileexcha...

6 years ago | 0

| accepted

Answered
create from a vector a vector of cumulative sums
Read about cumsum. A = rand(10,1) ; iwant = cumsum(A)

6 years ago | 0

| accepted

Answered
1D Shallow Water Equations Dam Break
https://in.mathworks.com/matlabcentral/fileexchange/46475-1d-shallow-water-equations-dam-break?focused=3818450&tab=function

6 years ago | 0

Answered
How to sum average annual data
Convert your date time into d,m,y, using datevec. Pick a year you want, get it's indices and use mean. Let A be your data. [y,...

6 years ago | 0

Answered
how to extract last 3 bits from binary string and then concatenate
iwant = Y1(:,8:10)

6 years ago | 0

| accepted

Answered
Extend a line of best fit
You have used polyfit, so you have slope and y-intercept in your hand. For a given value of x, you can find respective y value u...

6 years ago | 0

| accepted

Answered
using meshgrid data in a matrix
YOu should modify these lines: eps1=0:0.01:2; eps2=0:0.01:2; [e1,e2]=meshgrid(eps1,eps2); I hope that g_k, f_k are of same ...

6 years ago | 0

| accepted

Answered
How to extract the the right X,Y,Z value for obtaining the best contour plot similar than the complete contour
Option 1: load("A.mat") ; x = A(:,1); y = A(:,2); z = A(:,3); m = 21 ; n = 21 ; % can be changed xi = linspace(min(x),...

6 years ago | 0

| accepted

Answered
Some technical issues of Laplace Numerical Equations
Replace this line: unkp1 = 0.25*(un(i+1,j)+un(i-1,j)+un(i,j+1)+un(i,j-1)); with unkp1(i,j) = 0.25*(un(i+1,j)+un(i-1,j)+un(i,j...

6 years ago | 0

| accepted

Answered
Finding area UNDER two curves
Lets say you data is (x,y1) and (x,y2) which is of size m*2. Your curve for which you want area uses the minmum value of the two...

6 years ago | 0

| accepted

Answered
help using fzero to find the intersection
Try this: https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections?focused=5165138&tab=function

6 years ago | 0

Answered
draw two plot in a graph
The plot looks like a regression plot read about plotregression. If you have two data points and want to plot them read about pl...

6 years ago | 0

| accepted

Answered
Why I am getting sum =NaN. Help, here is my code.
If data has any NaN value, sum will be NaN....you need to omit nan while summing. You can use nansum. Read about it.

6 years ago | 0

| accepted

Answered
Sorting numbers according to elements of an array
SORTING = [3 7 11]'; input = 4.1; %code to compute which number it is closest to % output = 3; % GEt the absolute difference...

6 years ago | 1

| accepted

Answered
auto split matrix into other matrices (up to n)
A = [1 55 14 1 1 1 2 55 14 1 1 1 5 35 13 1 1 2 6 35 12 1 1 2 7 35 11 2 2 3 8 35 11 2 2 3]; C = A(:,end) ; [c,ia,ib] = ...

6 years ago | 0

| accepted

Answered
FZERO requires at least two input arguments
You have to provide inputs to the function. Save those functions in a file, in a folder. al = give your value ; bt = give y...

6 years ago | 1

Answered
How to split the data inside the matrix correctly?
Try this loop....I quicky typed it..check thorughly. data = [0 0 2.53164556962025 0 5.06329113924051 0 ...

6 years ago | 0

Answered
I want to plot the below equation in matlab but i dont know how to plot
Let the range of (x,y) be from 0 to 1 . m = 100 ; n = 100 ; x = linspace(0,1,m) ; y = linspace(0,1,n) ; [X,Y] = meshgrid(...

6 years ago | 0

Answered
Create a vector with binary values {0,1} with certain percentage of 0's and 1's
N = 10 ; % total numner of elements O = 6 ; % Number of 1 needed F = N-O ; % Number of 0 O = ones(1,O) ; F = zero...

6 years ago | 0

| accepted

Answered
saving images in loop
for i = 1: length(fwdposx) figure('color','w') drawfield(frateMaps{i},'jet',max(max(frateMaps{i}))); ...

6 years ago | 0

Answered
How I can show one plane of a 3D matrix double
To use imshow the input should be a matrix .....you may try imshow(squeeze(B))

6 years ago | 0

| accepted

Answered
Conversion of a vector file into raster
Let x,y,z be your column data. xi = min(x):0.5:max(x) ; yi = min(y):0.5:max(y) ; [X,Y] = meshgrid(xi,yi) ; Z = griddata...

6 years ago | 0

| accepted

Answered
Help with Delaunay Triangulations plot
I suggest to use this package for Delaunay Triangulation. https://in.mathworks.com/matlabcentral/fileexchange/25555-mesh2d-del...

6 years ago | 0

| accepted

Answered
In a randomly generated matrix how to find the position(row and column) of an element by using its value?
Your matrix has floating point numbers..you cannot get the value you want using like that. You should use: tol = 10^-5 ; % tole...

6 years ago | 2

| accepted

Load more