Community Profile # Are Mjaavatten

Last seen: Today 2015 以来アクティブ

Retired physicist with background in the petroleum and process industry. My main interests are mathematical modelling, numerical methods, and thermodynamics.

#### Statistics

All
• • • • • • • • • • • • バッジを表示

#### Content Feed

Error in setdiff function
One workaround is to replace all NaNs with some spceific value that is not present in your data, say -9999: >> S1 = [1,2,3,NaN,...

2ヶ月 前 | 0

How can I solve an ode where one of the variables is a matrix?
A(t) should be a function, not a vector. Below I define A as an anonymous function. I also use an anonymous function for your ...

2ヶ月 前 | 0

| 採用済み

4D data /Index exceed array bounds
I think it may be better to let M_Val be a cell array of 5 ordinary arrays, where M_Val{k} is of dimension 134 by 2 by nsyll(k)....

3ヶ月 前 | 0

4D data /Index exceed array bounds
I think you may have inadvertently created a cell array containing your whole data matrix in element 1. Something like this: >...

3ヶ月 前 | 0

How to find index range of range of values in an array
i = find(x>=69 & x<=72);;

6ヶ月 前 | 1

y coordinates of center of buoyancy
Is this what you want? x = [-8,-8,-6,0,6,8,8,-8]; y = [10,5,1,0,1,5,10,10]; ship=polyshape(x,y); figure(1) clf hold on p...

6ヶ月 前 | 0

Is it possible to convert a cell array into individual variables on workspace?
Dynamically creating variables in Matlab is not encouraged. See Stephen Cobeldick's tutorial entry. A better idea is to create ...

7ヶ月 前 | 0

How to plot a trinomial graph
fun = @(x) x^3; fplot(fun,[-3,3]) Alternatively: x = linspace(-3,3); plot(x,x.^3); % Note the use of .^, for element by ele...

7ヶ月 前 | 0

Fitting a 3D gaussian to a 3D matrix
meshgrid arranges the xx and yy output matrices to fit the convention where the surface plots have x on the horizontal axis and ...

7ヶ月 前 | 0

For loop assistance- incorrect data
You give DATA.s(3,1) the desired value in line 8 of exec2w. Then you overwrite it with the wrong value in line 22. I found deb...

10ヶ月 前 | 0

How can resolve r0<=r0_max?
I interpret your question to mean that you want copertura{mm,nn}(k,1) to take the value 1 if r0{mm,nn}(k,1) <= r0_max(mm,nn), an...

10ヶ月 前 | 0

Increasing precision of second order boundary value problem
Your asymptotic expansion solution seems to have zero slope at y = 0. This implies that the second derivative is zero and the s...

Error using + Matrix dimensions must agree.
In line 43, x(:,i) is a column vector, while k1' is a row vector. Summing a column vector and a row vector is not allowed in ol...

Golden Section Search algorithm, golden number why is 0.381
Let and be the end points of the current range. In golden ratio search we choose a new point such that the ratio of the two ...

1年以上 前 | 1

Problem relating to mathematical expression
Ameer's answer is correct, of course. Here is another approach, without the elegant Matlab functions: N = 5; % Max window size...

1年以上 前 | 0

Help text does not work for user-defined functions
Problem solved - finally! My Matlab 2019b and 2020a installations had several other odd behaviours in addition to the help prob...

1年以上 前 | 3

| 採用済み

Solution for system of two non linear equation
You can rewrite you equations as (Nd-x-y)-a*(x*(x+y)) = 0 (Nd-x-y)*(No-y)-b*(y*(x-y)) = 0 where x = Nd, y = Nonegative, a = ...

1年以上 前 | 1

| 採用済み

Problem of erf when using fmincon
Your problem has infinitely many solutions. Whenver x(1)-x(3) = 1 and x(2)-x(4) = 1, fun = 0, which is the minimum value possib...

1年以上 前 | 0

how to Nonlinear equations?(two variables)
Although R1 and R2 are nonlinear finctions of t, your equations are linear in x. So you write the equations on the form A(t)*...

1年以上 前 | 2

| 採用済み

How to count number of times a number appears in column B based on column A
letters = 'ABAACD'; numbers = [1,2,2,1,1,3]; uniqueletters = unique(letters); uniquenumbers = unique(numbers); n = length(un...

1年以上 前 | 0

| 採用済み

Van der Waals equation - Newton's method
In your code, newton_ndim does not know the value of T and so cannot call fun(X,T). You can probably fix this by defining an in...

1年以上 前 | 0

| 採用済み

How do I solve system of equations?
If I understand you correctly, your system consist of 128 eqations. a and b are arrays of 64 unknowns each. You must then solv...

1年以上 前 | 0

| 採用済み

Join repeated continuous elements of a vector
in = [1 1 1 2 2 3 6 6 6 1 1 1 4 4 4 2 2 2 6 4 4]; i = 1; count = 1; out = []; a = in(1); while i < length(in) i = i+1; ...

1年以上 前 | 0

Fsolve don't work good with trigonometric
Your function has several different zeros. Which one fsolve finds will depend on the starting point. I ran: f = 100; while no...

1年以上 前 | 0

Help text does not work for user-defined functions
I just installed R2019b and the help function does not work. Example: I created the addme function from the Add Help for Your P...

1年以上 前 | 2 件の回答 | 2

### 2

Is there a way to avoid repeating time-consuming calculations from odefun in the events function?
The right-hand side in my ODE is quite time-consuming. In the course of calculating dy/dt I calculate a variable u that I also u...

2年弱 前 | 2 件の回答 | 0

### 2

First order ODE parameter fit to dataset
The challenge is how to use your table of temperatures in your updateStates function. At a given time t, you must interpolate y...

| 採用済み

How to calculate a curve for different variables?
Here is one way to do it. I have reduced the number of elements in your Time and V vectors in order to make a nicer surface plo...

| 採用済み

datetime default stetings 12/24
Use HH instead of hh for the hours: >> datetime.setDefaultFormats('default','hh:mm:ss yyyy-MM-dd') >> t = datetime(2019,8,10,...

| 採用済み

How to read a file containing non numerical characters and commas?
The 22 lines of text are easily dealt with using the 'HeaderLines' option. Next you must convert your strings to doubles. Below...

| 採用済み
{"ft_lang_label":"__label__en","ft_lang_prob":0.73153245,"math_prob":0.9826868,"size":5980,"snap":"2021-31-2021-39","text_gpt3_token_len":1984,"char_repetition_ratio":0.110274434,"word_repetition_ratio":0.03641208,"special_character_ratio":0.309699,"punctuation_ratio":0.16411379,"nsfw_num_words":1,"has_unicode_error":false,"math_prob_llama3":0.9923063,"pos_list":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],"im_url_duplicate_count":[null,3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,6,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-20T23:05:35Z\",\"WARC-Record-ID\":\"<urn:uuid:62638a32-04bd-40bb-bf79-60c0595a8203>\",\"Content-Length\":\"130303\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:44eecd27-432e-4cc5-b6e5-215ab0f60f7a>\",\"WARC-Concurrent-To\":\"<urn:uuid:01c327ee-d036-4533-86fa-cab657fc081e>\",\"WARC-IP-Address\":\"23.220.132.54\",\"WARC-Target-URI\":\"https://jp.mathworks.com/matlabcentral/profile/authors/3934907?detail=answers\",\"WARC-Payload-Digest\":\"sha1:YI7WOODPYGYRHYI6N2NVDAG7KULI3RN6\",\"WARC-Block-Digest\":\"sha1:DUYMZVROOP67YQFMW7JISAJIS3KHLOM5\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780057119.85_warc_CC-MAIN-20210920221430-20210921011430-00013.warc.gz\"}"}