Answered
Plot Mean over Box Charts using Positional and Color Grouping Variables
Boxchart makes this really difficult! The location of the categories is well defined, but the offset (while easy to calculate) i...

2 years ago | 1

| accepted

Answered
How can I use multiple colormaps for contour plots ?
You can totally do this with three axes, I'm guessing the only bit you needed was to target the specific axes when setting the c...

2 years ago | 1

| accepted

Answered
How to signal divide into windows of lengths [1024] .
How about assembling up a matrix marking the indices of x you want. Of course you'll have to do something so that it's divisible...

2 years ago | 0

Answered
How to plot results from each iteration of a for loop SEPARATELY
You can do this in separate windows using the figure function: for i = 1:3 figure plot(rand(1,10)) end In separat...

2 years ago | 1

| accepted

Answered
How can I create a matrix with matrix elements of different datatypes?
You can use a cell array to mix datatypes: n=5; mat = cell(n,2); for i = 1:n mat{i,1} = i; mat{i,2} = -i:i; end m...

2 years ago | 0

Answered
Excel sheet extraction data
When you call readtable (or readmatrix or readcell) you can specify a range. I think the range has to be contiguous (i.e. you co...

2 years ago | 1

Answered
Questions about data types and tables
In your loop, X(:,i) is the contents of the table variable, and you're using it with dot indicating it as the name of the variab...

2 years ago | 0

| accepted

Answered
pdist2 output is larger than expected
pdist2 is providing all the pairwise distances. It compares row 1 of A with row 1 of B (Z(1,1)), then row 1 of A with row 2 of B...

2 years ago | 0

| accepted

Answered
plot values MATLAB table with conditions
The mistake here is thinking about this as an if statement, instead you want to use what people often call logical indexing. In ...

2 years ago | 0

| accepted

Answered
Replacing element in table
You can do point to table variables with the syntax tablename.variablename: X1=[9 6 9;3 2 7]; X2=[0 2;4 0]; X3=[3 1; 8 9]; X...

2 years ago | 0

| accepted

Answered
Matlab function doesnt run when called from AppDesigner
You're passing in characters containing numbers the values instead of the values themselves. Use str2num to convert before calli...

2 years ago | 0

| accepted

Answered
why my figure doesn't show the same logarithmic response like the one in the attached figure?.
I'm not sure how to match the y axis values, your equation didn't have much info about DPD, but it looks to me like you're missi...

2 years ago | 0

| accepted

Answered
how can i obtain just the real part instead of immaginary part ?
The functions real and imag pull out the real and imaginary parts: X = sqrt(-rand(3))+rand(3) R = real(X) I = imag(X)

2 years ago | 0

Answered
how to solve Index must not exceed 300
If you refer to the 301st item in a list of 300 things, MATLAB will error At least one of the variables in your equation cont...

2 years ago | 0

Answered
How can i apply standard diviation to the matrix?
You can use the std function to compute standard deviation

2 years ago | 0

Answered
How do i Plot average velocity from given velocity time data?
You were very close, you don't see it because you've plotted a vector t against a scalar Vavg and MATLAB has interpreted this as...

2 years ago | 1

| accepted

Answered
How can I define a set of constants to be used by many functions without having to define them in each one?
There are several way to organize this, here are a few ideas that help you avoid global state: First, you could pack these 10...

2 years ago | 1

| accepted

Answered
how can i truncte a matrix?
Are you asking how to take a 51 x 500 matrix and remove all but the first 71 columns? x = rand(51,500); x = x(:,1:71); % read ...

2 years ago | 0

Answered
How to find the correlation of rows across 2 tables?
I think you're saying you want a correlation for each state-month? Here's a simple approach that uses a nested loop. You could d...

2 years ago | 0

| accepted

Answered
Appdesigner error: Index exceeds the number of array elements (2). Error in Robotprac/Joint3SliderValueChanged (line 93)
Above, you set L(3).qlim = [-90 90]; On the line that errors: l = L(3).qlim; % so l is [-90 90] q(3) = l(3) + ... % This s...

2 years ago | 0

Answered
Error : "Check for incorrect argument data type or missing argument in call to function 'spawnTorpedo'."
spawnTorpedo is a (non-static, non-constructor) method, so the first argument should be the object: obj = torpedo; obj.spawnTo...

2 years ago | 1

| accepted

Answered
Semilog plot that includes curve fit
It turns out that semilogx is a shortcut for plot and setting the XScale property on the axes. So you can just do: plot(fitresu...

2 years ago | 0

| accepted

Answered
multiaxes and tiles inside a loop, how to plot different values for each tile independently
Here are answers to each of your questions Q1: How can I plot a horizontal line of 0.3 in zone 1 and another horizontal line ...

2 years ago | 0

Answered
Stacking multiple arrays into a matrix
You can make append two columns like this: a=rand(10,1); b=rand(10,1); c=[a b]; size(c) or like this: c=cat(2,a,b); size(...

2 years ago | 1

| accepted

Answered
Is there way to make heatmap with 3variabls?
To make an image like this, you need a matrix z which provides a point for each x and y. That's pretty easy to generate with i...

2 years ago | 0

| accepted

Answered
How do I create a simple loop to sum up the elements in my matrix assuming some elements vary.
You don't need a loop: a = rand(3,4) sum(a) % sum of each column, also sum(a,1) sum(a,2) % sum of each row sum(a,'all') % ...

2 years ago | 0

| accepted

Answered
how to plot impulses obtaining x and y values (non periodic) from 2 separate matrices
I think you were correct that stem is the correct command. I'm not sure why periodicity factors in, from your description...how ...

2 years ago | 1

Answered
How can I know the name of my table?
This is confusing because the word table means a few things, and because it's not entirely clear what you meant by "my table". T...

2 years ago | 0

Answered
How to plot this diagram?
A good function where you specify some co-ordinates and get a filled region is fill (I did a very bad job replicating your shape...

2 years ago | 1

| accepted

Answered
How to calculate difference between a vector
I think you're asking how to take the values [4 8 6 104 5] and subtract the mean? a = [4 8 6 104 5]; b = a-mean(a)

2 years ago | 1

| accepted

Load more