Réponse apportée
Gantt Chart on Matlab
Use only 3d column A = [ 1 0 11 2 11 24 3 24 40 4 40 60 5 60 80]; bar(A(:,3))

plus de 6 ans il y a | 0

Réponse apportée
How can I add a column of data to a matrix
Try my solution A = [A b(:)]

plus de 6 ans il y a | 0

Réponse apportée
Symbolic Calculation to Numeric value for limit of an integral
Look at your signal t = linspace(0,100); signal = @(t) -3*(sin((t-5/2)/3)); area(t,signal(t)) axis equal It never ends! Int...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Creating a matrix from spaced out lines of another matrix
Try this dx = max(x)-min(x); ix = round((x-min(x))/max(x)*2) + 1; % result 1 2 3 ind = cell(3,1); for i = 1:length(ind) ...

plus de 6 ans il y a | 0

Réponse apportée
How can I put an integral inside a for loop when the bounds depend on the loop's variable?
Here is an example for integral3 According to this integration is done from z to x You have only y. Looks like x=x(y) in yo...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
How to remove or exclude the intersecting part from two intersecting or overlaping spheres using Matlab?
Here is what i invented ix1 = (xc1-x2).^2+(yc1-y2).^2+(zc1-z2).^2 < R2^2; ix2 = (xc2-x1).^2+(yc2-y1).^2+(zc2-z1).^2 < R1^2; s...

plus de 6 ans il y a | 2

| A accepté

Réponse apportée
Using IF condition with ODE
Maybe you don't need event function for this case. I just add persistent variable to your ode function function main clear fun...

plus de 6 ans il y a | 0

Réponse apportée
how plot a correct interpolation with surf plot?
It happens because of different scales of data. Don't know why MATLAB get confused about it (even linear interpolation) scale...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
"dsolve" gives some extra terms in the solution
Here is comparison of solutions. See script inside

plus de 6 ans il y a | 0

Réponse apportée
Interpolating scattered data within a shapefile/worldmap
Here is my effort. Am i succeeded? S = importdata('CP_c.csv'); A = S.data; x = A(:,1); y = A(:,2); z = A(:,3); xx = linspa...

plus de 6 ans il y a | 0

Réponse apportée
How can I plot two variables with the line color varying as the third variable?
Use patch x = linspace(0,10); y = sin(x); c = jet(100); n = length(x); fv = [1:n-1;2:n]'; patch('faces',fv,'vertices',[x; ...

plus de 6 ans il y a | 0

Réponse apportée
Voronoi Diagram in Dashed Lines
Try to grab only handles of voronoi lines set(h(2:end),'linestyle','--')

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How to use normal, length, width, and center coordinates to create a rectangular surface in three dimensions?
Create Left vector using cross product p0 = [X Y Z]; % origin p1 = p0 + height/2*Up + width/2*left; p2 = ... % do al...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
Fill in missing NaNs
Use bwlabel A1 = isnan(A); % find NaN [L,n] = bwlabel(A1); % label each re...

plus de 6 ans il y a | 1

Réponse apportée
Need matlab coding for the given c program
try this i = 1; a{1} = '1'; while ~strcmp(a(i),'&') str = input('','s'); i = i + 1; a{i} = str; end

plus de 6 ans il y a | 0

Réponse apportée
How to pick an answer from solver for further calculations
Use logical operators ix = 0<Xi && Xi<1; x1 = Xi(ix);

plus de 6 ans il y a | 0

Réponse apportée
Question for color set in colorbar
Yes, there is a way. Use colormap cmap = hot(100); colormap(cmap(30:end,:)) % i use only last 70 values because first 3...

plus de 6 ans il y a | 0

Réponse apportée
Deleting overlapping segments between two vectors
Use bwselect cross = a.*b; ix = find(cross); % cross indices ia = bwselect(a,ix,1+ix*0); % find regions in ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How Can you redesign this code? Same result but different structure
You can remove some constants from for loop to speed up your code This part can be shorter and vectorized % for i=1:p % ...

plus de 6 ans il y a | 0

| A accepté

Réponse apportée
How can I plot an equation to its time lag?
Use for loops c(1) = w + (1-b)*(1+r)*a0 + D; for t = 1:n-1 c(t+1) = (1+r)*(c(t)-ch)*b + ch; end plot(1:n,c)

plus de 6 ans il y a | 0

Réponse apportée
Fullfile function gives me a false reading with the slash symbol
Try this Or you can remove slash symbol fileToRead(end-5) = [];

plus de 6 ans il y a | 0

Réponse apportée
Memory efficient vectorization of a for loop
Store values manually like sparse % preallocation? irow = []; icol = []; iplane = []; for i = 1:... % do stuff ...

plus de 6 ans il y a | 0

Réponse apportée
Change in velocity equation with explicit method
Here is what i think about this question for n = 2:length(t) if m(n-1) > me % if rocket has fuel dm = ...

plus de 6 ans il y a | 0

Réponse apportée
How do i store value in a array from for loop?
I give you simple example for a start n = 10; y = zeros(1,n); for i = 1:n-1 x = x + dx; dy = sin(x); y(i+1) = ...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
How can I plot a system of nonlinear ODEs with an added term used to model chemotherapy?
Here is an idea: function main t1 = 0.01; % start period t2 = tau-0.01; % end period hold on ...

plus de 6 ans il y a | 0

Réponse apportée
Create Bar Charts with different number of groups for each iteration.
Try NaN for f=1:nBFonds figure(f) Var = nan(1,26); pInd=transpose(peersInd==f); Var1 = [TotRetB(1,f);TotRet...

plus de 6 ans il y a | 1

Réponse apportée
Is griddedinterpolant omits NaN?
You can find out by yourself [X,Y] = meshgrid(0:10); Z = 0*X; Z(5:7,5:7) = nan; surf(X,Y,Z,'edgecolor','none') [X1,Y1] = ...

plus de 6 ans il y a | 1

| A accepté

Réponse apportée
Index in position 1 exceeds array bounds (must not exceed 1)
i am sure that indexing is right

plus de 6 ans il y a | 0

Réponse apportée
Produce equality matrix based on elements in vector.
Try bsxfun % make all combinations using bsxfun C = bsxfun(@minus,b(:),a(:)'); % b - rows, a - columns [i,j] = find(~C);...

plus de 6 ans il y a | 0

Réponse apportée
How to sum specific elements in a row of a matrix
try this A = rand(256); srow = 0; for i = 1:16:size(A,1) srow = srow + sum(A(i:i+3,:),1); end

plus de 6 ans il y a | 1

Charger plus