After i generate random numbers of x, how can i use this random x values to the rest of the code one by one. Because after that, I want to plot a friction factor-x number grapt with this different numbers
thank you so much. i corrected the friction factor but now other variables has the same problem. ı am a new learner and i didnt get the logic. could you help me for the rest too please?
isilay - it is probably a good idea if you post the error message and line of code that is causing the problem. You may want to review Array vs. Matrix Operations and pay particular attention to the array operators table. I also don't think I have all the values for each variable.
Incorrect dimensions for raising a matrix to a power. Check that the matrix is square and the power is a scalar. To perform elementwise matrix powers, use '.^'.
so line 51 is in the mpower built-in MATLAB function, but there must be something more to the error message that indicates which line of your code is causing the problem.
it may be that you just need to replace the exponent/power calls of ^ with .^...but this all depends upon whether you want to do an element-wise power (i.e. raise all elements in matrix to some power) or not.
array operations are for element-wise numeic operations.
If you are not doing linear algebra then using matrix operations is probably incorrect (but only you can know this!), and probably you should be using array operations. The different operators are explained here:
The code you showed in your new question has many locations where you are using matrix operators with arrays. I doubt that many (or any of those) operators are correct. For example:
isilay - I think that you need to step through each line of code (using the MATLAB debugger) and verify that all variables are as you expect and that, given their dimensions, the code is performing the correct operation.
Atleast one of its defining terms is non-scalar. There are no operations to reduce the size of that array, so BulkVelocity will also be non-scalar (with the same size as FrictionFactor2). And exactly the same for all the other variables listed and some more (because I stopped checking at that point).
You need to be much more thorough and actually look at the sizes of all of the variables, and then use the appropriate array operations. Note that if you are not perforning any linear algebra you could simply replace every matrix operation with an array operation (this would likely be much less effort than checking every variable).
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
0 Comments
Sign in to comment.