Answered
Finding intersection of curve and line.
Use this file exchange function InterX: https://in.mathworks.com/matlabcentral/fileexchange/22441-curve-intersections

5 years ago | 0

Answered
I'm ensure if this would be an efficient way to use Bisection Method to approximate x ^2 + x ^4 + 6 = x ^3 + x ^5 + 7 to produce the first 11 values of iteration
Two options. MAke it a function: BisectionMethod(f,a,b,n,tol) and give inputs and call. Remove the lines input and define th...

5 years ago | 0

Answered
How to plot complex function of two variables?
x = linspace(0,1) ; y = linspace(0,1) ; [X,Y] = meshgrid(x,y) ; Z = 1i/2*sqrt(X./Y) ; surf(X,Y,abs(Z)) hold on surf(...

5 years ago | 1

| accepted

Answered
How do I get the combination of cell array "wmn" and set up the preallocation of "wmn"
clc; clear all ; clc clear format long E=209e+3; q=-1; h=15; D=6.459478021978022e+07; I=2.8125e+02; a=600;b=2400; ...

5 years ago | 1

| accepted

Answered
How to observe density and size of catfish in the pond to measure weight?
I don't think that you are expecting an inbuilt function for this. You have to refer few papers, make your data and then you c...

5 years ago | 0

| accepted

Answered
Using movie() function to run .MAT file
load('myDat.mat') ; for i = 1:30 scatter3(locs(:,1),locs(:,2),locs(:,3),[],fittedLevels(i,:)','.') colorbar d...

5 years ago | 0

Answered
Finding specific data for a given condition
Let data be your m*2 array. To get number of atoms at t = 0, you can use interp1. t = data(:,1) ; % time N = data(:,2) ;...

5 years ago | 0

Answered
How to plot a 3D graph with its domain (projection on x-y plane) in one figure?
t=@(x,y)(sqrt(y-x-2)); x = 10:1:20; y = 10:1:20; [X, Y] = meshgrid(x, y); Z = t(X,Y) ; % Z is complex, use abs or real or...

5 years ago | 1

| accepted

Answered
Swap the First and Last Column (CODY)
A = rand(1,5) ; A([1 end]) = A([end 1])

5 years ago | 0

Answered
Error using / Matrix dimensions must agree.
x=(0:1:10); fx=1.1288./sqrt(x)-tanh(1.3288.*sqrt(x)) Read about matrix element by element operations.

5 years ago | 1

Answered
I am creating a vector but its throwing some error. Example I create vector a= [3.4 -4.90 0.23], and when I access it a[1] it gives error.
You should not use square braces.. a[1] not allowed. Use a(1) a= [3.4 -4.90 0.23] ; a(1) a(end)

5 years ago | 0

Answered
how to calculat the sequence?
u = rand(1,100) ; % data for demo k = 20 ; thesum = 0 ; for j = 1:k-1 thesum = thesum+sqrt(k-j)*u(j) ; end You can ...

5 years ago | 1

| accepted

Answered
Why do I receive error for reshape function?
The number of elements in X(:,j) is not equal to N*N, thats why you are getting error. N = 3 ; X = rand(10) ; x = reshape(...

5 years ago | 0

| accepted

Answered
Error when combine tables vertically
Read the csv files using readtable T1 = readtable('up_all.csv') ; T2 = readtable('upt_all.csv') ; The last variable name is d...

5 years ago | 1

| accepted

Answered
Indexing in for loop
You can read the documentation instead asking such simple questions. A = rand(10) ; [m,n] = size(A) ; for i = 1:m for ...

5 years ago | 0

Answered
difference between a= and a(:)=
a(1:N) will be either row or column vector depedning on a is row or column vector respectively. a(:) always gives you a column...

5 years ago | 1

Answered
Error in the function
You need to save the below code into a function named: decodare_txtf.m in some folder. function [dec_text]=decodare_txtf(I) ...

5 years ago | 0

| accepted

Answered
Plotting 2d contour plots as stacks in 3D
[X,Y,C] = peaks(100) ; figure hold on for i = 1:10 Z = i*ones(size(X)) ; Ci = rand*C ; surf(X,Y,Z,C) en...

5 years ago | 1

Answered
How can I plot two sinusoidal wave in one plot ?
Read about the function linspace, sin, plot and hold on.

5 years ago | 0

Answered
How to remove horizontal lines as plotting 0-360 degree map
Coast=load('Coast.mat'); X=Coast.long; Y=Coast.lat; % X(X<=0)=X(X<=0)+360; X = X+180 ; Y = Y+180 ; plot(X,Y);

5 years ago | 0

Answered
Computing the mean over 3 numbers in a matrix
Let A be your matrix. [m,n] = size(A) ; B = reshape(A,m,3,[]) ; C = mean(B,2) ; iwant = reshape(C,m,[]) ;

5 years ago | 0

| accepted

Answered
Random sample, I want the 5% of the data per each hour
Let A be your data matrix. [m,n] =size(A) ; p = round(5/100*m) ; idx = randsample(m,n) ; iwant = A(idx,:)

5 years ago | 0

Answered
Finding difference of array using alternative indexes
n = length(a) ; iwant = (a(2:n)-a(1:n-1))./((2:n)-(1:n-1)) ; Also have a look on geadient.

5 years ago | 0

Answered
MatLab help for a lost and confused student
Make matrix A with coefficients of the equaitions. Make column matrix b with the RHS values. You have equation Ax = b . Wher...

5 years ago | 1

| accepted

Answered
How to ignore points outside polygon shapefiles MATLAB mapping toolbox
REad about inpolygon, this will give you indices of points lying inside the polygon.

5 years ago | 0

Answered
how can i separate those columns which have same number of rows (e.g. the highlighted ones with fixed 7 rows ) by excluding zeros?
Let A be your matrix. B = A(:,sum(A>0)==7) ; % pick the required columns iwant = B(sum(B,2)>0,:) ; % remove the zeros if an...

5 years ago | 1

| accepted

Answered
How to make make the vectors the same length using different values of time?
Read about interp1.

5 years ago | 0

| accepted

Answered
Limiting the plot results to a max and min number
You can read about axis tight, axis, ylim, xlim. If these don't help show us your code.

5 years ago | 0

Answered
How is it possible to plot the average of a vector that has a different size in each iteration?
Mavg = zeros(10,1) ; for jj = 1:10 [G_dmg,G_orig, M,L_fail,overLoad,b] = Load_initial(G,5,0,460,1010,600,1000); t = ...

5 years ago | 0

| accepted

Answered
save filename by values using a variable
for j = for j = 3601:length(time) thedate = string(time3(j)) ; tiffile = strcat('Y_',thedate,'_',ncfile,'.tif') ; e...

5 years ago | 1

| accepted

Load more