Trying to use the quiver function on matlab but keep getting the error "??? Attempt to execute SCRIPT quiver as a function" I tried inputting in some sample code that my lecturer wrote down and not even that works. Have no clue. My code is : \n\nb = 1;\nc = 0.25;\n \n[y1 y2 ] = meshgrid(-4:.4:4,-4:.4:4);\ndy1 = y2;\ndy2 = -b.*y1 - c.*y1.^2;\nquiver(y1,y1,dy1,dy2);\n\nNote I had the original differential eqn: d2y/dt2 + by + cy^2 = 0, and then split it into two coupled first order DE's dy1 and dy2. If need more info let me know.
135073
You have a typo, in the quiver statement.\nchange the second y1 to y2 and try again
406519
I am not familiar with the 'square' function. Is it inherent to a particular toolbox? In any case, the function below will create a square wave where Fs, the duty cycle, and frequency are inputs. The function outputs the time matrix and the waveform matrix. Note that Fs should be greater than the frequency. Also, because of the for loops this code will run slow for large Fs. Anyway, I hope it is useful. \n____________\nfunction [time,sqwave] = sqwave(Fs, dutycycle, frequency)\n\ntime = (0:1/(Fs-1):1);\nperiod = 1/frequency;\n\nnt = max(time)/period;\ndt = 1/Fs;\n\nind = 1;\n\nfor j=1:nt\n\n    for i=0:dt:(period-dt)\n\n        if(i<=(dutycycle*period))\n            sqwave(ind) = 1;\n        else\n            sqwave(ind) = -1;\n        end\n\n        ind = ind + 1;\n\n    end\n\nend
464417
y = 3/(1 - x)²\n\n1, (1 - x)² ≥ 0 for all x and therefore 3/(1 - x)² ≥ 0 for all x\n\n2. 3/(1 - x)² is undefined when x = 0. Therefore 3/(1 - x)² (ie y) → +∞ when x → 1 from the left of 1 and when x → 1 from the right of 1\n\n3. As x → ±∞, 3/(1 - x)² (ie y) → 0\n\n4. Plot a few other points and Bob's your uncle!!
45148
"undefined expression" means "has no mathematical meaning."\n\nYou don't even need two variables, you can use one e.g.:\n\nLim    (-1)^n\n n->inf\n\nLim    tan(alpha)\n alpha->90deg
265974
This is counterexample is posted on Wikipedia; the link is below.  They don't explain all of the details, so I'll do that here.\n\nConsider the function f: R^2 -> R defined by\n\nf(x,y) = x y (x^2 - y^2) / (x^2 + y^2)\n\nI'm going to show that D_x (D_y f) is different from D_y (D_x f) at (x,y) = (0,0).\n\nThis function is continuous, because it is easy to check that lim_{(x,y) -> (0,0)} f(x,y) = 0.  Its derivatives are\n\nu(x,y) = D_x f(x,y) = y (x^4 + 4 x^2 y^2 - y^4) / (x^2 + y^2)^2\nv(x,y) = D_y f(x,y) = x (x^4 - 4 x^2 y^2 - y^4) / (x^2 + y^2)^2\n\nAgain, these functions are continuous, because lim_{(x,y) -> (0,0)} u(x,y) = lim_{(x,y) -> (0,0)} v(x,y) = 0.  Now to compute the mixed derivatives at (x,y) = (0,0), we need to compute the following limits.\n\nD_x (D_y f) @ (0,0) = lim_{h -> 0} ( v(h,0) - v(0,0) ) / h = lim_{h -> 0} h/h = 1\nD_y (D_x f) @ (0,0) = lim_{k -> 0} ( u(0,k) - u(0,0) ) / k = lim_{k -> 0} -k/k = -1\n\nHence these partial derivatives are *not* equal at (x,y) = (0,0) as claimed.\n\n-------------\n\nBy the way, I should point out that this gives a counter example to the famous statement\n\ndiv . curl (F) = 0\n\nIndeed, take F(x,y,z) to be that vector valued-function which is f(x,y) in the z-direction.  Then\n\ndiv . curl(F) = D_x (D_y f) - D_y (D_x f)\n\nIf you choose f(x,y) as above, then this expression is not zero at (x,y) = (0,0).
570307
You have two ways to do it...\nOne... if you have to do it on a graph paper... \nthen.. put some values of x and solve for y and make a table... and then plot those points on graph\n\nOtherwise.. use graph plotting softwares.. like gnuplot (which is a free software).. define function as f(x)=2x (f(x) is equivalent to y here) and say plot f(x).. it will plot you the function.
571284
Please explain what is ~f.  I have curiosity, because neither inverse multiplicative, complex conjugate or inverse function could do that result...\n\nIt should be interesting!! Please post what is ~f !
450904
here's an example\n\nwe want to reduce a matrix to u/t form\n\n1  10  -3       r1\n1  10   2       r2\n1  4     2       r3\n\n1  10  -3\n0  0     5      \n0  -6    5      \nr2-r1 \nr3-r1\n\n1  10  -3\n0  -6   5\n0   0   5      \n interchange rows 2 and 3\n\nupper triangular form\n\nthis is known as gaussian elimination\nand is used in solving systems of equations\n\ngo to the site:\n\nhttp://mathworld.wolfram.com/GaussianElimination.html\n\nthis gives a good example\n\nyou can also get help with other matrix\noperations at this site,plus access to the\nintegrator as well\n\ni hope that this helps
87185
false position is simply a way of estimating the zeroes of a function. I don't know about matlab, but you can find code for C/C++, java, and others at www.planetsourcecode.com\n\nHowever, if you're trying to solve a problem rather than just code false position, I would recomend secent method or newton's method as they provide a higher order of convergence
405497
So are you looking for a function with a singularity on (0,1)?  That would address the question I think.\nmaybe (x-(1/2))^(1/2)\n\nTHE FIRST ANSWER IS WRONG, I THINK, BECAUSE YOUR DOMAIN IS OPEN AND DOESN'T INCLUDE 0.
501266
// For any vector work I use structures.  For a 3-D vector define a structure as:\n\ntypedef struct\n{\n double x;\n double y;\n double z;\n} VECTOR;\n\n// Write a simple main to exercise some vector functions\n\nvoid main()\n{\n VECTOR VectorAdd(VECTOR A, VECTOR B);\n double VectorDot(VECTOR A, VECTOR B);\n VECTOR VectorCross(VECTOR A, VECTOR B);\n\n VECTOR a, b, c;\n double d;\n\n a.x = 1.0;\n a.y = 3.0;\na.z = 4.3;\n\n b.x = -2.3;\n b.y = 4.4;\n b.z = 1.1;\n\n c = VectorAdd(a, b);\n\n printf("Added: x: %lf, y: %lf, z: %lf&#92;n", c.x, c.y, c.z);\n\n c = VectorCross(a, b);\n\n printf("Crossed: x: %lf, y: %lf, z: %lf&#92;n", c.x, c.y, c.z);\n\n d = VectorDot(a, b);\n\n printf("Dotted: %lf&#92;n", d);\n\n}\n\nVECTOR VectorAdd(VECTOR A, VECTOR B)\n{\n VECTOR C;\n\n C.x = A.x + B.x;\n C.y = A.y + B.y;\n C.z = A.z + B.z;\n\n return C;\n}\n\nVECTOR VectorDot(VECTOR A, VECTOR B)\n{\n return A.x*B.x + A.y*B.y + A.z*B.z;\n}\n\nVECTOR VectorCross(VECTOR A, VECTOR B)\n{\n VECTOR C;\n\n C.x = A.y*B.z - A.z*B.y;\n C.y = A.z*B.x - A.x*B.z;\n C.z = A.x*B.y - A.y*B.x;\n\n return C;\n}
35837
Are there any linear algebra program solvers available? I am sure there are. Just use one of those.\n\n--------------\n\nI did a quick look on the web. I think it is built in already. Here are a couple of insruction manuals. Good luck.
219910
r u 4 r3al ?!! \n\nwhat mapping ? what equasion?  deckard maybe ? \n\nmore info please.
594639
start with   d = m / v        multiply both side by v; \nyou get     v * d = m        divide both sides by d; \nyou get     v = m / d
673
I haven't tried it, but check out MatPy (linked below).  Another possibility is Numerical Python (also linked below).
91200
These are two great reference sites for MATLAB.\n\n1) for MATLAB functions\nhttp://www.mathworks.com/access/helpdesk/help/techdoc/ref/ref.html\n\n2) for MATLAB programming techniques\nhttp://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/matlab_prog.html\n\ngood luck
28367
-1 works\n-1*3 + 1 = -2\n-2/2 = -1 (back to where we started)\n\nAddition> Now you say they should be pos! Jeez\n\n0 works though is it technically positive?\n\nWow, try a number like .1  - The numbers get REALLY big before coming back down to 1.  (5.00315450989997E+15)\n\n\n  Function IsOddNum(ByVal intNumber As Double) As Boolean\n    If (intNumber Mod 2 = 0) Then\n      Return False\n    Else\n      Return True\n    End If\n  End Function\n\n  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click\n    Dim num As Double = Convert.ToDouble(TextBox1.Text)\n    Dim count As Integer = 0\n    Literal1.Text = num.ToString() & "<BR>"\n    While num <> 1 And count <> 1000\n      If IsOddNum(num) Then\n        num = 3 * num + 1\n      Else\n        num = num / 2\n      End If\n      Literal1.Text &= num.ToString() & "<BR>"\n      count += 1\n    End While\n  End Sub\n\n\nAnother Note:  I just plotted the number of iterations for the numbers between 1 and 20,000.  The graph totally shows a pattern!  (Mathematicians love patterns)\n\nAnother Note, Doh, now the numbers have to be integers?  Jeez, there goes my repeating number answer.  Are you going to keep adding rules every time I get it right? LOL