Answered
I am getting error like invalid expression
the error is located in syntax of the run_L_p function. You need to change the numeric values into variables i.e. change funct...

circa un mese ago | 0

Answered
Setting XTicks with Datetime reuslt in an error
you can use datetimes directly as ticks. To make sure that all ticks are shown you can use the xticks command, and for readabili...

circa un mese ago | 0

Answered
Index in position 2 exceeds array bounds (must not exceed 1).
The error is due to the way you are accesing the data, based on you picture the inputs are row vectors. IS is a 1x6 vector. Howe...

circa un mese ago | 0

Answered
How to split a string and make multiple rows from the original data for each split?
Hi, there are several methods to do this. One way is to create an index vector and use this to copy the variable. See below :) ...

circa 2 mesi ago | 0

| accepted

Answered
For Loops using functions
if you do not want te keep the data from each iteration you can simply overwrite it i.e. use the same variable as input and outp...

circa 2 mesi ago | 0

| accepted

Answered
How to flot the function f(x,y)=(x^(2)+y^(2)) ℯ^(y^(2)-x^(2))
Hi, you can use the procedure below to investigate the range you are interested in. % create the function Fun = @(x,y) (x.^2+y...

circa 2 mesi ago | 0

Answered
How do I add data from one table to another?
Hello, you can simply append the tables, see below for an example Var1 = ["A";"B";"C";"D";"E"]; Var2 = [1;2;3;4;5]; Var3 = lo...

circa 2 mesi ago | 0

Answered
Write matlab code for the following algorithm
I'm not familiar with the algoritm, so it could still have some mistakes left... However, i was able to identify a couple of mi...

circa 2 mesi ago | 0

| accepted

Answered
How set table column to modified data?
See below, you can first extract the column names from the table. And use these as index during the loop. loadfile = load(websa...

circa 2 mesi ago | 0

| accepted

Answered
How to find X and Y coordinates of maximum gap between curves?
It depends on what you mean with the gap, notice that you plot it on a logarithmic axis. As a result from a graphical point of v...

circa 2 mesi ago | 3

| accepted

Answered
i need the curve of this fourier series
see below for a demo on how to set this up % set up the x values x = linspace(-3*pi, 3*pi, 1e3); % assume 10 terms for the ...

circa 2 mesi ago | 0

Answered
Match numbers to allocate text
you can use the categorical command to do this: y = [12 13 19 24 21 12 12]'; B = categorical( y, [12 13 19 21], ["A" "B" "C"...

circa 2 mesi ago | 0

| accepted

Answered
How to build a 3d map from raw data?
If you want to plot the curves in 3D, you can use the plot3 command. See below for an example: % read the data opts = spreadsh...

circa 2 mesi ago | 0

Answered
change the scale of colorbar
you can use the caxis command, simply add caxis( [0 0.02]) below the colorbar command. figure surf(rand(10,10)) c = colorbar;...

circa 2 mesi ago | 0

| accepted

Answered
What is the syntax for iterating over given coordinates, using a For loop?
You can do this in the following way: X1 = [10 12 14 23 24 23 18 16 12 10]; Y1 = [20 20 18 15 8 7 8 6 12 20]; for i = 1:num...

2 mesi ago | 0

| accepted

Answered
How to convert strings in a table to numbers?
An easy method would be to use the third output of the unique command. This will work directly on strings and will give the core...

2 mesi ago | 1

Answered
Extract value from every struct
You can acces the data in the struct by placing a point after the variable name of the struct, follewed by the fieldname you wan...

2 mesi ago | 0

Answered
text file to be in the folder
No need for the save command, first create the folder (or check that it exists) and then you can write the file directly into th...

3 mesi ago | 0

Answered
How to create a triangular shape using following Code in MATLAB
Based on the scatter mentioned in you question I combined the two loops and the resulting points in a single grid. This allows t...

3 mesi ago | 0

Answered
Running my code in a loop to make it more efficient
You can create a for loop, and just save the variables directly into matrices, see below for an example with 10 iterations and 7...

3 mesi ago | 0

| accepted

Answered
Count impulses into sequence of impulses and segments of sequences of impulses from signal
If the rectangles were drawn using matlab, then you know the start and stop time. Thus, if this works for the total number of p...

3 mesi ago | 0

Answered
Rewrite the format of a string
In the for loop, 'x' starts from 1, hence you will overwrite the data in iwant for each new file. One method to resolve this is...

3 mesi ago | 0

Answered
how to draw Bipartite Matrices and Projection Matrices.
such figures can be generated with the spy command. See below for an attempt to produce the top left figure using a bit of rando...

3 mesi ago | 0

| accepted

Answered
Array indices must be positive integers or logical values.
The following part of you code can produce an error: i starts at 1, hence you are trying to acces t(0) which is not possible. In...

3 mesi ago | 1

Answered
Average of multiple matrices
This depends how your images are stored in memory, if they are stored in a 3D array you can use the mean function % generate 3...

3 mesi ago | 0

| accepted

Answered
Vector question help?
% this step creates a vector with 25 normal distributed random values MyVector = randn( 1,25 ) % if you want to round these va...

3 mesi ago | 0

Answered
Plot an equation in time span T=[0,t]
You need to create a vector, below you can see a method using the "linspace" function. This creates a vector between 0 and t wit...

3 mesi ago | 0

| accepted

Answered
how to create random vector?
RandomDouble = rand(25,1) % i.e. pick 25 random values between 0 and 1 RandomIntegers = randi(1000,25,1) % i.e. pick 25 integer...

3 mesi ago | 0

| accepted

Answered
If else -statement doesn't work
The easiest method will be to first create a zero array, and then fill in the values according to the required logic: % intiali...

3 mesi ago | 1

Answered
calculate the volume obtained by rotating a function around the X-axis
Hello, since at first glance there are no internal voids you can use the convex hull function to determine the volume numericall...

3 mesi ago | 1

| accepted

Load more