Thank you SO much! This worked perfectly. If you wouldn't mind, could you explain what you mean by access beyond the end of the array? If p_count is just defined by the input, I can't seem to understand how could it be outside of the array.
Sorry I forgot to change that. Originally I had it as &piece[i].len but changed to .length just for the post.
My error comes from Xcode, saying "The subscripted value is not a pointer, array, or vector" and it underlines &piece[i].length and also &piece[i].width
Homework Statement
I do not have much experience with C, just a single course a few years ago, and I didn't do so well in it either.
I'm just trying to get familiar with structs in C. Basically what I want to do is just store the length and width of a rectangle using a function and a...
1. Homework Statement
Write an m.file that will integrate a function f(x, y) on any given rectangle (a,b)\times(c,d) and returns the value of the integral from a to b and c to d of the function f(x,y) . Include error-catching code in the case that the integral diverges. The program...
Homework Statement
A sphere rolling with an initial velocity of 30 ft/s starts up a plane inclined at an angle of 30o with the horizontal as shown. How far will it roll up the plane before it rolls back down?
Homework Equations
T_1+V_1=T_2+V_2
The Attempt at a Solution
We are...
Homework Statement
What is the mass moment of inertia about the y-axis of the object shown if the density is 4 slugs/ft3?
Homework Equations
I_y = \int (x^2 + z^2) dm
dm = \rho dV
The Attempt at a Solution
Not really too sure how to set this one up, my prof said it should be...
Homework Statement
All of this is in the attachment, but here is the question anyways.
"Two blocks of masses A, 50 kg and B, 30 kg are connected to a mass*less pulley which is connected to a wall. Determine the velocity of block B after it moves 0.5 m from its original position. Assume no...
Homework Statement
I attached the photo of the question that has everything.
Homework Equations
F=ma
The Attempt at a Solution
So I found the total mass of the system 50+35 = 85. Since we are given the force in the x-direction I used \frac{70}{85} = a = .8235 . The weight of...
Ok so for the x-direction since there is no acceleration then v_x = 110 and for y-direction v^2 = v_0^2 + 2(-g)(-144.9) to get v_y = 96.6 , this is my guess on what to do next.
v = \sqrt{v_x^2 + v_y^2} = 146.39
But that is a scalar..? So again I'm stuck. Thank you for your first...
Homework Statement
A stunt car is driven off a cliff with a speed of 110 ft/s. What is the gravitational acceleration of the car normal to its path after falling for 3 seconds?
Homework Equations
The kinematic equations...?
I'm pretty sure that this should be done in Normal and...
Homework Statement
Here is the entire problem set, but (obviously) you don't have to do it all, if you could just give me a few hints on where to even start, because I am completely lost.
Recall that we found the solutions of the Schrodinger equations
(x^2 - \partial_x ^2) V_n(x) =...