MATLAB help

Hey,
>>I have two arrays A and B.
>>Now I want the derivative of B with respect to A at all points of A.
>>So i move on to express B=f(A).
>>i use polyfit function and get the function f.
>>then i do f1=diff(f)
Now i am facing two problems:
1.when i express b=f(a) like y=x^4+(.02*x^3) and so on,it says " Error using ==> mpower
Matrix must be square."
2.it also says "Attempted to access f1(2); index out of bounds because numel(f1)=1."

what mistakes am i doing?๐Ÿ˜”๐Ÿ˜’

Thanks in advance.

Replies

  • durga ch
    durga ch
    what is A array and dimensions of A? and whats B , what function of A is B?
  • cranky
    cranky
    Hello there,
    For now lets say A=[1 2 3 4 5],B=[55 88 99 101 145].B=f(A) will be taken care of by polyfit right?
  • risingsun
    risingsun
    try using '.^' instead of '^' ..it should solve your problem ๐Ÿ˜€
  • durga ch
    durga ch
    Rising Sun is right. Since you are manipulating each element of the array, you should be going for a '.' function. Cranky, can you try as what rising sun suggested?
  • cranky
    cranky
    thank you.I will update you on that
  • WhAcK-O-NuT
    WhAcK-O-NuT
    Hello there people ! Cranky, I suggest you consider buying MATLAB's book written by RUDRA PRATAP. It's really good and shall assist you a great deal. It is a small book and is not expensive.๐Ÿ˜
  • jerseys
    jerseys
    what function of A is B?




    #-Link-Snipped-#

You are reading an archived discussion.

Related Posts

Father and son both work in same factory. The father leaves for work ten minutes earlier than his son. The father takes 30 minutes to walk to his factory, whereas...
meanings--: abnormal anxiety, morbid state of depression for which there is no real cause. Usage--: I think that she should take medical advice for her hypochondria.
hello. I want to ask for help. I am an electronics engineering student and I want to create a electric fan that will turn on when a person will come...
Building a homeade ATV/gobuggy. Anybody know how a drivetrain in a four-wheel drive ATV works. I need somebody to explain how power gets from the engine to the wheels. I...
Presently I am in the 4th year of my bachelors in computer science and I wanted to know if which would be a more better option: Going abroad for higher...