Matlab assignment help

such assignment pulled my attentiona and i took a while in solving it but then i reachd some friends and they said my answer isnt convincing enough
diffirintiating (calling function) ,
just maybe some1 around knows better in dealing with such quastions in matlab

Here it is:


Description

Write a user defined function to calculate (numerical) the derivative of a polynomial function. The name of this user defined function must be: plot_dif_func Calling for plot_dif_func a plot of the derivative of the polynomial function must be created and numerical data must be generated as well. This numerical output consist of two arrays, one for the argument(x) and one for the calculated (dy/dx).

Don’t forget to add some help text within the function-file. Lookfor build in functions like sqrt(x),sin(x), cos(x),…

· The function definition line, must look like:

function[argument,dydx]=plot_dif_func(polynomial_func, variable)

· polynomial_func: This is the place where you type the polynomial fnction. For example if you have a input-func-tion like:
h(x)=2*x.^3+2*x+3 then you type 2*x.^3+2*x+3
instead of the text "polynomial_func"

· variable: This is the place where you type the name of the variable for the input-function (x). Because this variable is also used outside the function, it should be defined before calling the function
plot_dif_func .

After calling de function plot_dif_func you will also have 2 output vectors called argument and dydx. These two vectors can be used to plot the derivative of the arbitrary function in a second plot window.


and this is my answer , if some1 can help me understand more the question it'll be awesome cz what i know is calling function and the rest i just did it impulsivly , not sure if it make sense

i'll post it within short notice

if some1 is good at matlab i would be gladful even if i get a bit of clues and hints ,

cheers

Replies

  • gargoor
    gargoor
    Re: Matlab

    function[argument,dydx]=plot_dif_func(f_y,x)
    x=linspace(-2,2,20)
    % just randomly chozen numbers
    f_y=((x.^2)-(x)+(1))./((x.^2)+(x)+1) %just randomly chosen function
    %x=variables
    %f_y=polynomial function
    %dydx=the derivative of the veriable
    %argument=the derivative of the polynomial function
    dydx=diff(x); % just to clearify what is dydx
    argument=diff(f_y);
    Z=argument./dydx
    % i added this command so the output can be plotted because without this command the output graph will be straight line
    subplot(121)
    plot(x,f_y,
    'k')
    title(
    'graph of inputs')
    subplot(122)
    plot(Z)
    title(
    'graph of outputs')
    end
  • gargoor
    gargoor
    Re: Matlab

    can some 1 explain also for me what arbitrary is ? in math and in common life usage of the word ,
  • Predictor
    Predictor
    Re: Matlab

    gargoor
    can some 1 explain also for me what arbitrary is ? in math and in common life usage of the word ,
    In everyday use, as was indicated, "arbitrary" means "at random". In a statistical context, though, we would more specifically note that things which are "arbitrary" do not necessarily have known probability distributions. In other words, asking people to arbitrarily pick numbers from 1 to 10 is unlikely to result in a uniform distribution of values from 1 through 10.


    -Will Dwinnell
    Data Mining in MATLAB
  • gargoor
    gargoor
    no one likes matlab around here 😛 to bother solving such assignment ?!
  • silverscorpion
    silverscorpion
    Clearly state what is your doubt in this assignment. also, tell what you want exactly.

    I saw the code, and I thin nothing is wrong with it.
    Apparently, many MATLAB enthusiasts are here, and I'm one too.
    So, you've to first make us understand what you need, so we can help you.
  • gargoor
    gargoor
    ,, i totally cleared what's my question up ?! i think its totally undertandable but no worries , .. for now thanks for your answer
    beside the questions marks i included up , i got one more Q,

    * what will be the difference if i clearified the variables (inputs+outputs) befor writing this statement
    function[argument,dydx]=plot_dif_func(f_y,x)
    ???
  • gargoor
    gargoor
    this's Terriffic, bunch of thanks for all you

You are reading an archived discussion.

Related Posts

Name: *Engineering Trade: Electrical Location: Hyderabad *Occupation: Working as a software Engineer Work Experience: 2+ *Hobbies & Interests: Reading books, listening to music, watching movies and blogging *Aim in life:...
Totally Blank so far Areas of Interest: 1. Image Processing - Image Segmentation and Recognition 2. Web Applications - nothing Any suggestions
Help needed with contraptions heyy!!! m a 2nd yr btech student of nit kurukshetra.. i need some help regarding the topic contraption. i want to knw about the differnt energy...
Depression is here and the politicians are about to hyperinflate their fiat currencies to nothingness as a finale furioso hell-tax. So we go for gold, which always has been money...
I have got a worm in my pendrive which prevents deletion of any files in the pendrive. Cant format it either. Any help?