Answered
Writing a function for the h-index
My understanding of h-index comes from publishing, for example this definition. If M is your data matrix, already sorted, then ...

21 dagar ago | 0

| accepted

Answered
Check for incorrect argument data type or missing argument in call to function 'dateshift'.
I get the error from your first statement as well: % This statement would give an error % dateshift('17:03:41', 'start', 'hour...

21 dagar ago | 0

Answered
Finding x value for y values on a dataset.
The algorithm you want is not perfectly clear, and I can't see quite how you get the output from your input. But it seems that y...

21 dagar ago | 1

| accepted

Answered
not enough input arguments( not what you think)
How are you calling this function? I put your function in a file named beam.m, then called it from the Command Window using be...

22 dagar ago | 1

Answered
Colon Notation Function using Matrices
A(2,2:3) means "the 2nd row, 2nd-through-3rd column of A". B(:,2) means "all rows, 2nd column of B". I strongly recommend th...

22 dagar ago | 0

Answered
How do I sum a vector (row) to a matrix?
A=[1 0 0 1; -1 0 1 1; 1 1 1 1]; B=[1 2 2 1]; A(1,:) = A(1,: ) + B

22 dagar ago | 0

Answered
Why I cannot exit the for cycle with the "z" counter?
It looks your syntax is correct for what you are trying to do, and the if statement is correctly placed. My best guess is that ...

23 dagar ago | 0

Answered
Custom Fit Sometimes Work Sometimes Doesn't
You say this is the "same code and data". So, what is different? Or are you literally running everything in exactly the same way...

25 dagar ago | 0

Answered
Why does repeating pca on randomized data switch the order of the points? Compare the test case and the Monte-Carlo case.
I have to admit that I did not spend the time to come to a complete understanding of your code. However, I'm guessing that your...

26 dagar ago | 2

| accepted

Answered
How to plot graph with multiple values of x in a function
You need to use elementwise operations: count=0; for i=[3,5,7,10,20,100] count=count+1; x=linspace(-5,2,i); sub...

27 dagar ago | 1

| accepted

Answered
Matlab R2021a will not open after upgrade to MacOS Monterey
It looks from this chart of system requirements that R2021b is the only version to be compatible with Monterey.

28 dagar ago | 0

Answered
Natsort Rows using in program.
You need to ... go to the submission's page here click the Download button on the right-hand side of the page unzip the zip f...

28 dagar ago | 0

Answered
How to get the R (not R^2) from a linear regression 'poly1'?
Assuming you just want the correlation coefficient of the data, you don't need the model: corrcoef(x,y)

ungefär en månad ago | 0

| accepted

Answered
Solve unknow array/matrix
% Input B = [3 0; 0 2]; C = [1 2 3; 4 5 6]; % Solve for A A = B\C % Verify B * A

ungefär en månad ago | 1

Answered
Inverse of matrix is wrong?
Looks fine to me: val=zeros(1,583); j=[10,10E-1,10E-2,(9:-1:1)*(10^-3)]; val(1:12)=j; sum_val=sum(val); val_norm=val/sum_va...

ungefär en månad ago | 2

Answered
Fit curve to a model problem
Personally, I would use fitnlm from the Statistics and Machine Learning Toolbox, but that is mainly due to familiarity, I suppos...

ungefär en månad ago | 0

| accepted

Answered
NaN (not a number) in numerical integration
Looks like your function becomes infinite. Here's a plot zooming in where it happens ep=0.2; u=0.2; lam=0.7; n=1000; f=@(al...

ungefär en månad ago | 0

Answered
Pythagorean triples - wrong output in loop
You need R(I+1, :) = [a+b+c, a, b, c]; rather than R(a, :) = [a+b+c, a, b, c]; For sorting, after your run your algorithm, r...

ungefär en månad ago | 0

| accepted

Answered
How to avoid the mistake plot if one x value corresponding to two or more y values?
If the density of your points is high enough, you could consider plotting only the markers, and not the connecting lines, e.g. ...

ungefär en månad ago | 0

Answered
Error in untitled (line 3)
The first argument to quad2d needs to be a function handle. I am not familiar with eprload, but its output looks like (x,y) dat...

ungefär en månad ago | 0

| accepted

Answered
select a character value to display depending on the value entered
I believe this will do what you want. Define the cell array lt_list = {'Constant','Constant on below' ... etc then lt1 = lt...

ungefär en månad ago | 0

| accepted

Answered
How can I fit histogram?
Answering the first part of your question ... With probability normalization, the sum of the bin heights will be 1. With pdf no...

ungefär en månad ago | 1

| accepted

Answered
I'm trying to create a function and it's not working, I don't know what's wrong with it?
You need x=-2.*pi:0.01:2.*pi; instead of using semicolons for defining the vector.

ungefär en månad ago | 0

Answered
function periodic in matlab
I think this does what you want: x = -3*pi : 0.01 : 3*pi; f = @(x) (mod(x+pi/2,pi) - pi/2).^2; figure plot(x,f(x))

ungefär en månad ago | 0

Answered
Highest row number in a table
% Example table n = 7; x = rand(n,1); y = rand(n,1); T = table(x,y); % Get number of rows MaxRows = size(T,1)

ungefär en månad ago | 0

| accepted

Answered
Interpretation of whisker in a boxplot for lognormal distribution
If I have done this correctly, it is about 92.2% ... % Calculation for normal distribution q3 = norminv(0.75,0,1); q1 = normi...

ungefär en månad ago | 0

| accepted

Answered
Looping through 4 Images that have fixed names
IMList="app.IM"+(1:4) creates a 1x4 string array, and then you can loop through that array to use the names.

ungefär en månad ago | 0

Answered
Table Find Duplicate Rows (double, char, datetime)
You might need to share some more details about your table, but you should be able to use the unique function. % Make some pret...

ungefär en månad ago | 0

Answered
Histogram of overlaid standard normal draws
If you look carefully, you will notice that your bins are not at precisely the same locations. If you instead choose the exact b...

ungefär en månad ago | 1

| accepted

Answered
How do I sum the elements in a vector up to a specific value?
Here is one way: v = [2,3,2,2,1,3,1,10,3]; prize = sum(v(1:find(v==10,1)-1))

ungefär en månad ago | 0