Solved


Draw a x-by-x matrix 'Denmark flag'(Euro(2020)
Draw a x-by-x matrix 'Denmark flag' using '4' and '1'.(x is odd and bigger than 4) Number 4: Caption S.Kjær and number 1: K.S...

5 years ago

Solved


Reindex a vector
You are given two vectors of equal length. Vector N has numeric values (no Inf or NaN) while vector IDX has integers. Place th...

5 years ago

Solved


intersection of matrices
Given two matrices filled with ones and zeros, determine if they share a common row, column entry. These matrices are of identi...

5 years ago

Answered
Adding Legend to Bar Graph
If you are concerned of coloring all bars specifically, then you need to use this code: figure() Labelit = {}; CL = [1 0 0; 0...

5 years ago | 0

Solved


Gallery function, learning
write a Function, edit something or Add something that give us like the following for random n: n=2 ans= [ 0 1 ...

5 years ago

Solved


Numbers spiral diagonals (Part 1)
Inspired by Project Euler n°28 et 58. A n x n spiral matrix is obtained by starting with the number 1 and moving to the right...

5 years ago

Solved


Divisors for big integer
Inspired by Problem 1025 and Project Euler 12. Given n, return the number y of integers that divide N. For example, with ...

5 years ago

Solved


Sum of big primes without primes
Inspired by Project Euler n°10 (I am quite obviously a fan). With problem n°250 by Doug, you can find some global methods to ...

5 years ago

Answered
Fit an exponential curve
1st of all, your data's good fit is not 6.5*exp(a*x) that is why cftool is giving you the best fit that differs from your expect...

5 years ago | 0

Answered
How can I find a character in a string?
Hi, Here is one of the many possible solutions to your exercise: clearvars fid = fopen('TEXT__R.txt', 'r'); % Your text f...

5 years ago | 0

Answered
How to do a boxcar smoothing in mathlab ?
You can easily employ the following data filtering fcns: doc smooth doc filter doc conv https://www.mathworks.com/help/curve...

5 years ago | 0

Answered
Migrating 2015b code to 2018b
In fact, in general all M-files (Simulink .slx and .mdl files) are forward compatible. However, there a few fcn/command syntaxes...

5 years ago | 0

Answered
Delete first row matrix and records new value
Have you read this documentation for DAQ tools and fcns of MATLAB: https://www.mathworks.com/products/data-acquisition.html ...

5 years ago | 0

Answered
How to conditionally format a variable with fprintf
Hi, Here is an easy solution with if cond operator: ... fprintf(fid, '%s\n', T_names{:}); for ii=1:numel(y) if y{ii}~=0 ...

5 years ago | 0

Answered
I don't understand how to use the sgolay function for signal edges
Start your code with: clearvars Then it should work

5 years ago | 0

Answered
Adding Legend to Bar Graph
Hi, here is an easy solution to your exercise: Labelit={}; LEG = {"Jump", 'Run', 'Squat', 'Cycle', 'Other'}; for ii=1:5 b...

5 years ago | 0

Answered
Experts of MATLAB, how did you learn? Any advice for beginner/intermediate users?
Really great points on practical and theoretical aspects how to study and master programming in MATLAB environment. My learnig e...

5 years ago | 0

Answered
How to get the normalized data from the histogram
See this doc (check for normalization under property of histogram): https://www.mathworks.com/help/matlab/ref/matlab.graphics.ch...

5 years ago | 0

Answered
Overlapping graphs in figure
Here is a bit edited and corrected code: figure() for i=1:length(nodos)-1 plot([nodos(i):0.01:nodos(i+1)],polyval([Mx(:,:,i...

5 years ago | 0

| accepted

Answered
Sketch the graph using matlab
f=@(x, y)(x.*y.*sin(x-y)./(1+x.^2+y.^2)); syms x y dFxy = diff(f,x)+diff(f, y); fimplicit3(f); hold on; fimplicit(dFxy, 'k', ...

5 years ago | 0

Answered
Saving a Datasource programmatically
The last line in your posted code: saveAsJDBCDataSource() is not MATLAB's builtin fcn unless you have your own or 3rd party fcn ...

5 years ago | 0

Answered
why matlab take a lot of time in the symbolic calculation
The problem with integral2 calculation part not with vpasolve(). You need to check the limit values for xmin, xmax, ymin, ymax i...

5 years ago | 0

| accepted

Answered
Regression plot help for a range of data
No need to employ meshgrid() for calculations instead, use color ":" operator that performs vectorized calcs. L=...; u=......

5 years ago | 0

| accepted

Answered
Logical indexing in cell array
Now, what michio suggested works perfectly ok: b = {'1' '2' '3' '4' '5' '6'}; b(cellfun(@(x) strcmp(x,'3'), b))={'Found 3'} S...

5 years ago | 0

Answered
Vectors must be the same length.
A small err in t's size: ... t = t(1:end-1); % 1 last value has to be removed. ...

5 years ago | 0

Answered
Sketch the graph using matlab
Start with fimplicit(@(x, y)...)

5 years ago | 0

Answered
I have a problem saving data
Or save in a different directory, e.g.: save('C:\Users\..\realizacionU12A') Change your current directory (cd ) and then save...

5 years ago | 0

| accepted

Answered
How to use if statement for than one variables?
Note that for loop and "if" based calcs are very slow and inefficient. Anyhow if indeed you wish to fix your code, then check ...

5 years ago | 0

| accepted

Answered
How to use if statement for than one variables?
There are several errs in your loop code that is not advised. Just because it is slow and inefficient. Here is an easy sol isnt...

5 years ago | 0

Answered
Sum of a series containing table column data
What is the value of k? Just presuming k is taken from the number of elements in T, the calc can be done, e.g: k=0:numel(T)-1; ...

5 years ago | 0

Load more