Finding the Value of S in Matlab Code

  • MATLAB
  • Thread starter flyinwelshman
  • Start date
  • Tags
    Matlab
In summary, the conversation discusses the difficulty of finding the value of S in a Matlab code, as it is dependent on several other variables. The code includes equations and conditions to evaluate S, but it is not possible to obtain a definite value without more information.
  • #1
flyinwelshman
1
0
* Hello I'm fairly new to Matlab and I'm having trouble iterating. I'm trying to find the value S however the equation needed to evaluate it depends on S (second line). What is the best way to find S? Any help would be greatly appreciated :) My code:

Code:
V=Q/(W*R);
Us = (9.81*R*S)^0.5; 
if ((Us*d/v)>1.2) && ((Us*d/v)<70);
Vcr=w*((2.5/(log10(Us*d/v)-0.06))+0.66); 
else Vcr=w*2.05; 
end

I = 5.435-0.286*log10(w*d/v)-0.457*log10(Us/w);
J = 1.799-0.409*log10(w*d/v)-0.314*log10(Us/w); 
S=(w*Cts*10^(I/J))/(V-Vcr);
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
We would have required more information than what you've provided. As you require a definite value of ##Us##, and that is a function of ##S##, this method will not work.
 

FAQ: Finding the Value of S in Matlab Code

1. What is the purpose of finding the value S in Matlab code?

The value S in Matlab code represents a variable that stores a numerical value. It is used for calculations and can also be used to store data for future use. Finding the value S allows the user to manipulate and analyze data in their code.

2. How do I find the value S in Matlab code?

To find the value S in Matlab code, you can use the built-in function "find" which searches for elements in an array that meet a specified condition. Alternatively, you can use the command line to manually search for the value S in your code.

3. Can I change the value of S in Matlab code?

Yes, the value of S in Matlab code can be changed by assigning a new value to the variable. You can also use different mathematical operations to manipulate the value of S and update it in your code.

4. What happens if I cannot find the value S in my Matlab code?

If you cannot find the value S in your Matlab code, it is possible that the variable has not been defined or declared correctly. Make sure to check your code for any errors and ensure that the variable is properly initialized before trying to find its value.

5. Is it possible to find multiple instances of the value S in Matlab code?

Yes, it is possible to find multiple instances of the value S in Matlab code. The "find" function can return an array of indices where the specified condition is met. This allows you to locate all instances of the value S in your code.

Similar threads

Replies
41
Views
9K
Replies
1
Views
4K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
1
Views
2K
Replies
9
Views
2K
Replies
1
Views
2K
Back
Top