[Solved] Writing a function that calculates sine for inputted number of terms. MATLAB [closed]

[ad_1] found the answer myself.. note that there is a difference between sinx and sin(x) function [sinx, error] = sinx_approx(x) % approximates the value of sin(x), the approximation is more accurate as % the number of terms selected is increased. n= input(‘Up to how many terms would you like to evaluate?’); sinx=0; for i=1:1:n sinx=(-1)^(i+1) … Read more

[Solved] nested IF, AND, OR function compare and give result excel

[ad_1] Try this formula =MATCH(G5,{“Prica Plus”,”Miks S”,”Miks M”,”Miks L”,”Miks XL”,”Miks XL Plus”,”Miks XXL”,”Super”},0)-MATCH(F5,{“Prica Plus”,”Miks S”,”Miks M”,”Miks L”,”Miks XL”,”Miks XL Plus”,”Miks XXL”,”Super”},0) Above formula can be broken down in two parts. Firstly, matching Cell G5 to your values =MATCH(G5,{“Prica Plus”,”Miks S”,”Miks M”,”Miks L”,”Miks XL”,”Miks XL Plus”,”Miks XXL”,”Super”},0) Secondly, matching Cell H5 to your values =MATCH(F5,{“Prica Plus”,”Miks … Read more

[Solved] Built in function to compare strings in C++?

[ad_1] You could use std::string::compare() which provides the same functionality as strcmp(). std::string name1 = “John”; std::string name2 = “Micheal”; int result = name1.compare(name2); Would roughly be the same as: const char* name1 = “John”; const char* name2 = “Micheal”; int result = std::strcmp(name1, name2); [ad_2] solved Built in function to compare strings in C++?

[Solved] How to put an input in a function

[ad_1] You are never defining the function you’re trying to call. You’re printing from the function but never returning a value, thus your variable “a” will never get a value. Take a look at this, hopefully you’ll see where you went wrong: def odd(x): if int(x) % 2 == 0: return(“this number is even”) else: … Read more

[Solved] Javascript rock paper scissors project

[ad_1] Try this corrected and verified JavaScript Code – var rock = rock; var paper= paper; var snip = snip; var playerOneName= prompt(“what is your name”); playerOne = choice(); var playerTwoName = prompt(“what is your name”); playerTwo=choice(); alert(‘Player 1 Chose – ‘+ playerOne + ‘Player 2 Chose – ‘+playerTwo); function choice(pick){ return(prompt(“rock paper or snip”)); … Read more