Answered
What are variable scopes?
Example: sections between function .. end are scopes of variables function main x = linspace(0,2); y1 = f1(x); y...

6 years ago | 0

Answered
how to code color bar in specific time?
You can manually correct colorbar values h = colorbar; s = datestr( linspace(7e5,7.5e5,10) , 'dd/mm/yyyy' ); set(h,'YtickLabe...

6 years ago | 1

| accepted

Answered
Add background colour for certain values in a plot
I couldn't open your data (maybe my MATLAB is older). I created some data and here is an example clc,clear x = linspace(0,20...

6 years ago | 0

| accepted

Answered
How to label answers from a function you called in a script?
You just want to pass your functions to SecantMethod if i understood your correctly Type this in the main script syms x1(t) la...

6 years ago | 0

Answered
Large dataset legend for two colours
You can use hadlers h1 = plot() hold on h2 = plot() hold off legend(h1,'legend red') legend(h2,'legend blue')

6 years ago | 0

Answered
Plotting single graphs per excel sheet
Look HERE how to count sheets in excel

6 years ago | 0

Answered
shooting method solving compressible boundary layer equations
bvp4c should work see attached script

6 years ago | 2

| accepted

Answered
How to plot a Map with 2 dimensional colorbar?
Here is a way: clc,clear n = 100; I = zeros(n,n,3); h = linspace(0,1/6,n); s = linspace(1,0,n/2); [H,S] = meshgrid(h,s);...

6 years ago | 2

| accepted

Answered
Solver for nonlinear second order ODE has large residuals when mass matrix becomes state dependent
Where is this part? B = -K * th(1:N) - (C + CC) * th(m:n) + T_G + T_M1 - T_L ; dydt(m:n) = (J-T_m1)\B; % solv...

6 years ago | 0

Answered
How to accelerate my code
What about findpeaks()? X = load('datat.txt'); X1 = X(1:100); [~,ix1] = findpeaks(X1); [~,ix2] = findpeaks(-X1); plot(X1,'....

6 years ago | 0

Answered
bar chart with wrong legend referring
Get handlers (put it into for loop) h(nB) = bar(x, data(:,nB), 'FaceColor', map(nB,:),'BarWidth',0.1); And try this w = 0...

6 years ago | 0

| accepted

Answered
Equations with Variables & User input
Use coeffs syms x y z eqn = (x + 2*y + 10*z)/2; [c,t] = coeffs(eqn) sum(c.*t) Also try simplify(eqn)

6 years ago | 1

| accepted

Answered
how to subs more than one value in one equation
Place variables in square brackets syms x y z eqn = x + 2*y + z; eqn1 = subs(eqn,[x z],[0 0]) % new equation with repl...

6 years ago | 0

Answered
How to use the streamline function for a circular area?
You can just make new grid/mesh for your data (standard rectangular, corners are NaN) Here is a way: clc,clear load test.ma...

6 years ago | 2

| accepted

Answered
How to solve nonlinear coupled ode by Shooting method .
Try bvp4c Suggestion: F0 = y(1); %% ... H1 = y(7); % and use these variables to make your code more redable dy(1) ...

6 years ago | 1

Answered
Vectorizing multiple for loops in Matlab
I changed your code a bit See attached script

6 years ago | 1

| accepted

Answered
Linking marker face color to colorbar
Try scatter clc,clear cds_BD = [1.1105 1.3124 1.0474 1.0978 1.0852 1.0474 1.0221 1.0347 1.1988]; cd...

6 years ago | 0

| accepted

Answered
plotting two x aes and 1 y axes for one plot
Example with two axes. Idea is from HERE x1 = 0:0.1:40; y1 = 4.*cos(x1)./(x1+2); plot(x1,y1,'r') ax1 = gca; ax1_pos = get...

6 years ago | 1

| accepted

Answered
How to write a code to calculate the f '(3)?
Try symbolic expression syms f(x) f(x) = x^2; f1 = diff(f); f1(5)

6 years ago | 0

Answered
Help if statment inside a while loop
Try to add these conditions if (error >= 500) && a<9 a = a+9 elseif error>=200 && c<9 c = c+9 end Please use this...

6 years ago | 1

Answered
Using quiver plot, how to show the states of polarization (SoP) in the cross-section of a vector beam?
Here is a way See attached script

6 years ago | 2

| accepted

Answered
Extracting data from excel spreadsheet
Use xlsread to read data Use surf to display it

6 years ago | 0

Answered
how to process defocused particle in an image
I have an idea: Binarize image two times with different threshold Separate each blob with bwlabel Compare areas of intersect...

6 years ago | 0

| accepted

Answered
With Azimuth and Elevation of a satellite, how to plot the location of the satellite marked with a blue X in the picture?
Just use built-in function sph2cart [X,Y,Z] = sph2cart(az,el,r); plot3(0,0,0,'^r') % human hold on plot3(X,Y,...

6 years ago | 0

Answered
How to estimate area via simpson's rule from trapezoidal area calculated from discrete data points
You have 500 points for X data and 5 points for each row or Y data. Assuming that X is distributed evenly: Y = your data; X = ...

6 years ago | 0

Answered
Coloring regions and plotting boundaries
Use can use patch() ! x = linspace(0,10); y = sin(x); plot(x,y) p = patch([1 1 2 2],[-1 1 1 -1],''); set(p,'FaceAlpha',...

6 years ago | 0

Answered
3D plot of kinect x,y,z data over time - question
I give a start clc,clear cla A = xlsread('pp1_trial1.xls'); nn = 1:19; X = A(:,nn); % read first 19 co...

6 years ago | 0

Answered
get 3D angles of vectors
If cit is your 3D data vj = cit(ind,:); %Getting the 3D coordinates use cart2sph v = diff(cit); ...

6 years ago | 0

| accepted

Answered
How can I plot a Helical phase fronts similar to the following picture
Use meshgrid and surf commands

6 years ago | 2

| accepted

Answered
extract planes from point cloud
Here is my attempt Here is what it produces: See the attached script

6 years ago | 0

| accepted

Load more