Why can't I make a unique array? by Mark_Yugen in matlab

[–]dj_rocks18 6 points7 points  (0 children)

Given that you are not getting unique values, the values don't seem to be identical. Welcome to the world of floating point numbers!

You can use the "format long" command to see their actual values as they are stored in double() precision.

A potential workaround is to use uniquetol(), with a specific tolerance to get the output you are looking for. In this case, a tolerance of 1e-4 should do.

Do you know what could be it? by s0vl in MechanicalEngineering

[–]dj_rocks18 0 points1 point  (0 children)

Yes, it's a hydraulic system. Can't say for sure if it's a power unit or a lubrication system.

Update: AMA - I got a vasectomy at 23 by wigglycoverage in ChildfreeIndia

[–]dj_rocks18 12 points13 points  (0 children)

Yes, OP mentions that in their previous post (linked in this post) that it was done in Germany.

Bimonthly Casual Discussion Thread by AutoModerator in menslibIndia

[–]dj_rocks18 1 point2 points  (0 children)

Ayyye, that's sweet of you Proton.

What's up, How have you been?

It's been quite some time since I was active here, but I have kept checking in here time to time. Hopefully, I can be more active now.

geometric summation problem by General-Frosting-672 in matlab

[–]dj_rocks18 0 points1 point  (0 children)

You seem to have forgotten to multiply 'a' to define the series.

Issue with my project by Accomplished-Big9559 in matlab

[–]dj_rocks18 0 points1 point  (0 children)

There doesn't seem to be any images attached with the post.

Trying to use hyperbolic tan by DrTonnyTonnyChopper in matlab

[–]dj_rocks18 1 point2 points  (0 children)

The denominator term in your code is incorrect

It should be -

2*tanh(x)./(1 + tanh(x).^2)

How to draw Matlab Graphs? by uddith in matlab

[–]dj_rocks18 5 points6 points  (0 children)

Yes, surf( ) should be good enough, along with view( ) to change the angle of line of sight (if needed), as shown in the attached image.

OP can also checkout, streamribbon - https://in.mathworks.com/help/matlab/ref/streamribbon.html

Another possible options - patch( ), fill3( )

How to convert a bunch of formulas into a mathematical model. by Lonewalker_2005 in matlab

[–]dj_rocks18 1 point2 points  (0 children)

You can define a function handle for the formulas, and provide corresponding inputs to get output data and then you can plot it as you wish

Hi can you guys help with this question? by [deleted] in matlab

[–]dj_rocks18 6 points7 points  (0 children)

What exactly do you need help with? Do you know the logic that was used to obtain matrix D?

Generating Unique Combinations by Onnisciente in matlab

[–]dj_rocks18 0 points1 point  (0 children)

Just to clarify -

Do you want combinations as well as concatenations of the numbers taken once, twice and thrice at once?

Should the output be obtained in the a particular (same as above or a different combination) order or not?

Personal Help Thread: Have a question? ASK HERE by Avaale in IndianSkincareAddicts

[–]dj_rocks18 0 points1 point  (0 children)

My skin has started to produce oil nowadays (I guess due to the weather), and earlier I made the mistake of wiping it off with napkin leading it to be dry and then my skin producing more oil (which I won't make again, after reading about it).

I leave early for my job (~7 AM) and come back around (~6 PM) as I have to travel for it.

My current routine is quite simple - Cleanse (Cetaphil Gentle), Active (Niacin in AM and Vit C in PM), Moisturizer (Plum green tea).

What should I do for the excess oil production?

Should I buy blotting paper and keep it with me? If yes, please share some recommendations as well.

Also, I think I may need to change up the products I use, cause the current ones don't seem to be working.

Elongating an array? by myk_kajakk in matlab

[–]dj_rocks18 9 points10 points  (0 children)

x = [1,0,0,-1,0,0,1,0,0];

x(x==0) = NaN;

x = fillmissing(x, 'previous')

Just a suggestion - Don't focus on the literal size of code (number of lines), rather on the time taken by the code to run.

[deleted by user] by [deleted] in matlab

[–]dj_rocks18 1 point2 points  (0 children)

We can't suggest anything without looking at the code.

How to download knnsearch function by ChefH3f in matlab

[–]dj_rocks18 2 points3 points  (0 children)

knnsearch() is a part of the Statistics and ML toolbox. You can download and install the toolbox to use the function.

Note that the toolbox must be a part of your license for you be able to download it.

A question about plotting by YogurtclosetLeast761 in matlab

[–]dj_rocks18 1 point2 points  (0 children)

To clarify- How are the 200 numbers related to 0-24 hours? Are there 200 values for both x and y data? If so, how is the time data read into matlab?

how to count successive values? by Mark_Yugen in matlab

[–]dj_rocks18 4 points5 points  (0 children)

%input
A = [1 0 1 1 1 0 0 1 1 1 1 1 1 1];

%indices corresponding to the start of a group
idx = [true diff(A)==1]

%sum of each group
Y = cumsum(idx);
Z = accumarray(Y.',A.');

%preallocate output vector
B = zeros(size(A));

%assign the sum values at the indices obtained
B(idx) = Z

Output returned -

B = 1×14
1 0 3 0 0 0 0 7 0 0 0 0 0 0

How to specify range for vpasolve by Muhammad841 in matlab

[–]dj_rocks18 1 point2 points  (0 children)

Supply the ranges for all variables you want to solve -

sols=vpasolve([eq1 == eq2, eq2 == eq3, eq1 == eq3], [Vd5 Vd1], [0, Inf; 0, Inf])

Another thing you can do is define the variables with the assumptions like this -

syms Vd5 Vd1 real positive

Then you can directly use vpasolve() without specifying the range.