Community Profile

# Daniel Pollard

##### Last seen: Today
92 total contributions since 2020

View details...

Contributions in
View by

Array indices must be positive integers or logical values
You wrote psi(i,j) = ((U0*V0)./W)*cos(W(t-YY(i,j)./V0))-V0*XX(i,j); Try psi(i,j) = ((U0*V0)./W)*cos(W*(t-YY(i,j)./V0))-V0*XX(...

etwa 23 Stunden ago | 0

Solved

Find the largest number
Find the largest number |x| among 4 numbers given as variables |a|, |b|, |c|, and |d|. Example: Input: a = 4; b = 7; c ...

6 Tage ago

How to combine multiple curve fits in one plot?
https://www.mathworks.com/help/matlab/creating_plots/combine-multiple-plots.html This was literally the top result when I googl...

19 Tage ago | 0

Why is validateattributes returning me a Not enough inputs error only in this context?
I was assigning the class to a vector in reverse order, using a loop like for k = 16:-1:1 lsqsin(k) = LsqSinusoid(N_sample...

etwa ein Monat ago | 0

| accepted

Question

Why is validateattributes returning me a Not enough inputs error only in this context?
I have a class definition called LsqSinusoid(n_samples, f, Fs). The constructor for that class takes three inputs - n_samples, t...

etwa ein Monat ago | 1 answer | 0

### 1

While loop for testing the end of vector (Matlab)
If you know that it's 1-dimensional, you can use numel(vector) which returns the length of your vector. Also useful to know i...

etwa 2 Monate ago | 1

Finding numChanges in array
Replace for i=1;length(V) with for ii = 1:length(V) The semicolon -> colon is a typo I suspect, and i has a built in value s...

etwa 2 Monate ago | 1

| accepted

How to plot a graph in nm
Your method works perfectly well. An alternative option would be theta = 10 wavelength = [500:10:700] m = 1 d = (m.*waveleng...

2 Monate ago | 1

| accepted

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 10-by-10. not sure why i am getting this error
Biot_top is size 10x10. dtMat(1,j) is size 1x1. This means the LHS of your line is 1x1, and the RHS is 10x10, so you can't make ...

2 Monate ago | 0

| accepted

How to create one errorbar for multiple data points?
If I understand you right, could you do something like figure; hold on plot(x, y, 'bx') errorbar(mean(x), mean(y), std(y), 'k...

2 Monate ago | 1

| accepted

Graph with similar axis value with the value given
You want xticks and yticks. As a note: you need the vectors to be in ascending order, and your second tickmark vector isn't. so...

2 Monate ago | 0

Does MathWorks have software for rocket trajectory modeling at supersonic speed?
The Aerospace toolbox is likely to be the closest to what you want. I don't use it so don't know much about it, but it seems to ...

2 Monate ago | 0

Something like option = input("Type A for degree to radians, and B for radians to degrees: ", 's') if option == "A" degs ...

2 Monate ago | 0

How can I plot histogram?
Simply googling "matlab histogram" would have answered your question. That link is for the documentation for histogram. histog...

2 Monate ago | 0

Double for loop is not working properly
k will take the values [1 2]. For the first iteration of k, it stores data{1,1}(:,14) in ch{1,n}. The second time around, it wil...

3 Monate ago | 0

| accepted

Uneven linspacing of an array
If I understand right, you have a vector len, and you want to have a vector x such that diff(x)=len. In that case, you can use t...

3 Monate ago | 0

Problem with running a Matlab code.
Clear your variables by putting the command clear at the start of your programme. It's almost certainly holding onto variable...

3 Monate ago | 0

| accepted

How Create a vector given size(N) and the value of the max element(M)?
Are those the only conditions? linspace(1, M, N) has N values which range from 1 to M.

3 Monate ago | 0

| accepted

Using sample code but returning a blank plot
You create a label and a title for a plot, but at no point do you feed it actual data to plot. Why would it do anything but prod...

3 Monate ago | 0

Create a Slanted Linspace Matrix
If you have the signal processing toolbox, the buffer command will do exactly what you want. If not, something like x = linsp...

3 Monate ago | 0

log ticks on Y-axis
set(gca, 'YScale', 'log') Is this what you mean?

3 Monate ago | 0

| accepted

error message how to solve !?
The error message is exactly what it says. You defined a function, which is not defined if one of your inputs is a function hand...

3 Monate ago | 0

MATLAB isn't working to generate figures
Use hold on and hold off when generating figures. I've not used imshow before, but I'll guess that each time you generate a figu...

3 Monate ago | 0

How to add a NaN row at the beginning columns of a table?
for jj = 1:5 A(:,jj) = [NaN([jj 1]); B(1:end-jj)] A(T.id(1:end) ~= [NaN([jj 1]); T.id(1:end-jj)], jj) = NaN; end I h...

3 Monate ago | 1

| accepted

signal to noise ratio (SNR)
According to the documentation, "r = snr(x,y) returns the signal-to-noise ratio (SNR) in decibels of a signal, x, by computing ...

3 Monate ago | 0

| accepted

How can I get archived documentation for a R2012b release?
As per the other answer, 2012b doesn't have easily accessed documentation. I have found, however, the 2012b release notes in thi...

3 Monate ago | 0

How to Integrate ?
Wolfram alpha is useful here to show you what can be done. If you click that link you'll see that I asked it to do which is ...

3 Monate ago | 0

Min and max value of many results
Good news! Matlab has built in min and max commands. So it's pretty straightforward to define them and store them in a vector: ...

3 Monate ago | 1

Question

Is it possible to include LaTeX expressions as text in my code?
I have a piece of code, where some of the variables can have their values chosen by me as and when I want. The values have very ...

3 Monate ago | 2 answers | 0