Gelöst


Determine if input is odd
Given the input n, return true if n is odd or false if n is even.

mehr als 14 Jahre vor

Gelöst


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

mehr als 14 Jahre vor

Gelöst


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

mehr als 14 Jahre vor

Gelöst


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

mehr als 14 Jahre vor

Beantwortet
Cell matrix
For the first part, here's how to create two cell arrays that are BEST_BID and BEST_ASK: BEST_BID = myArray(strcmp(n(:,2),'...

mehr als 14 Jahre vor | 0

Beantwortet
integration
use the trapz function source: help file

mehr als 14 Jahre vor | 1

| akzeptiert

Beantwortet
plotyy with sync yaxis tics on both sides
Matlab allows you to switch the ticks on both axes. plotyy is creating two overlapping axes on the figure. When you execute this...

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
Can I do this?
It looks like this is all that's wrong: func = @(x) x(3)*(47e3-Al(x)+Aj(x)+Ak(x)); I'm assuming x is a 3 value vector?

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
Plot using scatter3 function.
It takes 3 variables to make a plot in scatter3, but if you mean you have 3 sets of x,y,z parameters then: figure hold o...

mehr als 14 Jahre vor | 0

Beantwortet
Plot a second order equation and plot two equations on the same grafic
You can plot multiple sets of data on one figure multiple ways. The first way would be: plot(x1,y1,x2,y2,...) The next m...

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
How must I declare a function handle that refers to a function you've written? What syntax is necessary?
Is 'spectrum' actually getting passed into your function psi_en? It looks like, if it isn't and 'en' in passed in correctly, 'y'...

mehr als 14 Jahre vor | 0

Frage


polar interpolation of data acquired in a cartesian plane
I'm working on a problem that I've modeled as: [x,y] = meshgrid(-20:0.1:20,-20:2:20); xx = vectorizeMatrix(x); yy = v...

mehr als 14 Jahre vor | 0 Antworten | 1

0

Antworten

Beantwortet
Write a loop that can generate all data in one M-file with one variable change
To answer your comments: After looking back at the code, I made a big assumption that's not the best to make I think. I assum...

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
What am I doing wrong!?
Ah I see the problem now. In your original post you had s1 = [0.4, 0.4, 1.6]; but nothing using s1 in it. Now that I see...

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
Plot a time series with the whole number not 10^(n)
Yeah I deleted my answer after I realized that num2str doesn't work properly, but found that num2cell does. Glad it worked for y...

mehr als 14 Jahre vor | 1

Beantwortet
What am I doing wrong!?
I'd suggest using the following code, it's not pretty, but it gets the job done without any toolboxes. x0 = [0.2, 0.4, 0.6]...

mehr als 14 Jahre vor | 0

Beantwortet
Write a loop that can generate all data in one M-file with one variable change
You could just add another dimension to your hh and tt calculations like this: for j = -1:-1:-5 q = 0; dt = 10^j; ...

mehr als 14 Jahre vor | 0

Beantwortet
Saving data to EXCEL
Are you having problems at this line? xlswrite(resultsfilename,RESULTSLOCATION,1,'A10:num2str(j)'); If so, I would bet th...

mehr als 14 Jahre vor | 0

Beantwortet
Store a variable in a loop
how about something simple like this? n = [0 0.01 0.5 0.6 1 1.2 1.5]; for i = 1:length(n) stored(i,1) = 1 + n(i);...

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
Plotting atan()
Not sure I'm understanding the question, are you wanting to replace any values > pi/2 with pi/2? (and any values < -pi/2 with -p...

mehr als 14 Jahre vor | 1

Beantwortet
Out of Memory using fgetl
Just throwing out ideas here, is your error coming at the first call to fgetl or after calling fopen? Could it be that matlab...

mehr als 14 Jahre vor | 0

Beantwortet
Plotting a function
f = @(x) 1/((.8441^2-x^2)^2+(.8441*x/4)^2)^(1/2); fplot(f,[0,2])

mehr als 14 Jahre vor | 0

| akzeptiert

Beantwortet
??? Error using ==> double Too many input arguments.
total = total + double(int(5.119*exp(-0.08898*x)+13.47*exp(-0.0003734*x)),x,t2,t2+ton); Your parentheses are incorrect here....

mehr als 14 Jahre vor | 0

Beantwortet
save a variable nameing it after a string
can you not import the string prior to saving? something like: ... str = importFun(file); eval([str ' = matToSave;'])...

mehr als 14 Jahre vor | 1

| akzeptiert

Frage


Error when using validatestring in inputParser addOptional
I'm getting the following error when running isenExpan('a','m',2,1.4,'sub') with the code below: ??? Error using ==> isenExp...

mehr als 14 Jahre vor | 1 Antwort | 2

1

Antwort