How to create multiple tables from a single spreadsheet
You can specify a range when calling readtable: For example: T = readtable('patients.xls',... 'Range','C2:E6',... ...

12 days ago | 0

| accepted

Coding colors with the use of combing matrices
One thing you could do is use uisetcolor to pick the exact shade of yellow orange and pink you like Another thing you could d...

13 days ago | 0

How to get rid of floating-point constants
The error you describe isn't what I'd expect, but you're certainly missing a *. Unless exp isn't the matlab function exp and is ...

13 days ago | 1

continuous signal to discrete
You didn't really describe what you tried and where you got stuck...how about a simplified example that has all of the building ...

13 days ago | 0

How do you set every other row as well as every other column to zero?
To remove every other column, set it to empty. You can do "every other" generally using A:2:B where A is the first value and B i...

13 days ago | 1

| accepted

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...

13 days ago | 1

| accepted

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...

14 days ago | 0

| accepted

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...

14 days ago | 0

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...

14 days ago | 1

| accepted

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...

14 days ago | 0

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...

14 days ago | 1

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...

14 days ago | 0

| accepted

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...

14 days ago | 0

| accepted

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 ...

14 days ago | 0

| accepted

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...

14 days ago | 0

| accepted

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...

15 days ago | 0

| accepted

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...

15 days ago | 0

| accepted

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)

15 days ago | 0

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...

15 days ago | 0

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

15 days ago | 0

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...

15 days ago | 1

| accepted

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...

15 days ago | 1

| accepted

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 ...

15 days ago | 0

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...

16 days ago | 0

| accepted

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...

16 days ago | 0

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...

16 days ago | 1

| accepted

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...

16 days ago | 0

| accepted

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 ...

16 days ago | 0

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(...

16 days ago | 1

| accepted