Answered
Generate combinations with scaleable code
There happens to be a quite obfuscated way to do this: n = 9; a_all_combos = 2*(dec2bin(0:2^n-1) - '0') - 1

3 years ago | 0

| accepted

Answered
why do I get the Error using imageDatastore (line 6) Expected a string scalar or character vector for the parameter name.
The inputs to imageDatastore function, after the location, are supposed to be Name,Value pairs. Your syntax of just having true...

3 years ago | 1

| accepted

Answered
Prevent y-axis log scale to cut out bins in normalized histogram
You should be able to use set(gca,'YLim',[bottom top]) % Put in the values you want for bottom and top of axis

3 years ago | 0

| accepted

Answered
asking about command in matlab
Are you willing to spend some time learning MATLAB? You will fully understand that line of code if you Watch the free, online M...

3 years ago | 1

Answered
Homogeneous plate of width a=2 m and height b=1 m is exposed to fixed temperatures on its sides. Determine stationary temperature distribution inside the plate, if coefficient
In this line of code T = (T1 + T2 + T3 + T4) / 4; you initialize T to be a scalar value, but you seem to expect it to be an ar...

3 years ago | 0

Answered
Split data into training and validation sets
There are several ways to do this. (I'm curious if you even tried to google this, because there are many answers online.) Here ...

3 years ago | 2

| accepted

Answered
How would I type this function correctly?
I guess it is fair to say that you have not really learned basic MATLAB syntax at all. I would recommend starting to learn the ...

3 years ago | 2

| accepted

Answered
Calling other function from another m file
External functions are actually known to MATLAB by their filename, so you do need to put it in a separate file.

3 years ago | 0

| accepted

Answered
for loops out of bounds
i = 0:0.5:pi

3 years ago | 0

Answered
How to set the output file name same as input names but with an additional word
If I understand your code correctly, then you've got FileName = 'MyFirstFile'; So, you could get your new filename as newFile...

3 years ago | 0

| accepted

Answered
Sort Cell Array after accumarray function
Here is one way: % Your code row_f=({0;0;0;1;2;3;4;0}); row_s=({'a';'a';'b';'b';'c';'c';'a';'b'}); t={'12/09/2022 04:28:01 P...

3 years ago | 1

Answered
How to get daily temperatures of past 30 years for a given location from NOAA online database
Here is how you can do this using webread: myToken = 'PUT_YOUR_TOKEN_BETWEEN_THESE_QUOTES'; myURL = 'https://www.ncei.noaa.gov...

3 years ago | 0

| accepted

Answered
How to get daily temperatures of past 30 years for a given location from NOAA online database
Here is an example that worked for me (using my own token, of course). It uses MATLAB's system function to call the system's cu...

3 years ago | 0

Answered
clarification regarding "silhoutte" plot
The Wikipedia page for silhouette clustering has a pretty good explanation, if you read it carefully and understand it. For eac...

3 years ago | 0

Answered
Remove Rows that are entirely NaN
For tables, there is a very handy rmmissing function: % I am reading from the file you posted here, but you can of course read ...

3 years ago | 0

Answered
Lagrange polynomial: two equivalent m-files
Assuming you are talking about this submission to the FEX, it is not from Mathworks. It is a user-contributed function. I guess ...

3 years ago | 0

Answered
How to find the 5 minimum values in a multidimensional matrix and the indices to which these entries correspond.
% Some input data rng default M = rand(3); % Find the sorted values of M, and the linear matrix indexing to them [sortedM,...

3 years ago | 1

| accepted

Answered
NIST Randomness test execution
This github repo has code that claims to run the NIST suite. I have not personally tried it.

3 years ago | 0

Answered
How do I compare a cell array containing string arrays against a string array without using loops?
I think more can be done, but here a couple improvements that make the small test case faster. Hopefully it is an ever larger sp...

3 years ago | 1

Answered
Logical operations of multi dimensional matrices
If you do M == reshape(v,1,1,3) then MATLAB will implicitly expand the vector across dimension 1 and 2, to do the equality che...

3 years ago | 1

| accepted

Answered
Incongruities in InputFormat in datetime
I don't think you wrote the formatspec correctly. Is this what you want? s = '2022-12-08T14:37:14.625Z'; formatspec = 'yyyy-MM...

3 years ago | 0

Answered
Select values from an array to evalaute data training
X = [0:0.05:1]'; Xval = [0.3 0.65 0.75 0.8]'; [tf,loc] = ismembertol(Xval,X) % Using ismembertol rather than ismember, to av...

3 years ago | 0

| accepted

Answered
All codes relation to steering mechanism s
Please read this guide about how to ask a good question, and edit your question to improve it.

3 years ago | 0

Answered
How to add specific y-value in y-axis of plot
You could use either the text or annotation function to do that. Here is an example using text: rng default x = rand(5,1); ...

3 years ago | 0

| accepted

Answered
Error on using movmean function -> shifted coordinates
If you look at data matrix you import, it has a discontinuity between elements 245 and 246: matrix = readmatrix('https://www.ma...

3 years ago | 1

Answered
Hello everyone. Please can I have code for Nicholson-Bailey model
Please do follow @Walter Roberson's advice, and read that guide. One of the suggestions is to google first. I did that, and turn...

3 years ago | 0

Answered
Nested loop for matrix
I'm guessing you intended g(k,i) rather than g(k,:) in the last line of the for loop.

3 years ago | 0

Answered
Store numbers from 1 to 100 in a 10x10 matrix
g = reshape(1:100,10,10) g = reshape(1:100,10,10).'

3 years ago | 1

| accepted

Answered
Im using nlinfit function and I need to know the R square for the fitted solution
rng default N = 100; x = randn(N,1); y = 2 + 3*x + 5*randn(N,1); modelfun = @(F,x) F(1) + F(2)*x; beta0 = [0 0]; [be...

3 years ago | 1

Answered
i want to plot this data noise = [0 1 5 10]; mis_bits= [0 3 5 7]; error_dev= [0 0.6288 0.8048 1.0080] where is the standard deviation as shown below , how to that with matla
Use the errorbar function. I'm not certain about your descriptions, but I think this is what you want: noise = [0 1 5 10]; mi...

3 years ago | 1

Load more