Beantwortet
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;...

mehr als ein Jahr vor | 0

| akzeptiert

Beantwortet
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...

mehr als ein Jahr vor | 0

| akzeptiert

Beantwortet
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...

mehr als ein Jahr vor | 1

Beantwortet
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...

mehr als ein Jahr vor | 0

Beantwortet
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...

fast 2 Jahre vor | 0

Beantwortet
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...

fast 2 Jahre vor | 0

Beantwortet
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...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 2 Jahre vor | 0

Beantwortet
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...

fast 2 Jahre vor | 0

Beantwortet
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...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 2 Jahre vor | 1

Beantwortet
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...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 2 Jahre vor | 0

Beantwortet
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...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

fast 2 Jahre vor | 1

Beantwortet
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...

fast 2 Jahre vor | 1

| akzeptiert

Beantwortet
To concatenate single column of a cell array
You can use cell2mat to do this, see below for an example % generate cell array with random data C = cell( 3072 , 2); C = cel...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to use Matlab to solve equation like Mathcad
Use the symboic toolbox to determine the equations, see below. syms fp1 fp2 fz1 fz2 fc boost real eqn = boost == ( atan(fc/fz1...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Error in writing the output to excel file
As indicated in the error message you need to convert the sym into a double or a string, see below for both options syms m1 m2 ...

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
Trying to find the corresponding value of a matrix with an input?
see below for the interpolation fig = openfig('VelocityAgainstRodHeight500Hz.fig'); axObjs = fig.Children; dataObjs = axObjs....

fast 2 Jahre vor | 1

| akzeptiert

Beantwortet
How introduce a delay of one second in MATLAB?
you can use the "pause" function, this will pause matlab for the given amount of time pause(1)

fast 2 Jahre vor | 0

| akzeptiert

Beantwortet
create a sparse multidimensional matrix
you can either fill it in directly or use blkdiag to create this shape: % direct method % on row 3 7 and 11, column 1 2 3 resp...

fast 2 Jahre vor | 0

Beantwortet
How to define if a point is inside or outside a 3D pyramidal area?
Hi, asuming you want to use as many standard matlab functions, the easiest method i can think is by constructing two terahedrond...

fast 2 Jahre vor | 1

Beantwortet
How can I create a quadratic matrix with variables?
you do not need to use .' in this case, only use the transpose operator: syms q1dot q2dot q3dot q4dot q5dot real qdot= [q1dot...

fast 2 Jahre vor | 0

Beantwortet
Frequency words for each labels
Edit to make so that the code works with the latter added example data... % read the file data = readtable("dati_classificat...

fast 2 Jahre vor | 1

| akzeptiert

Beantwortet
Order Matlab not to continue until the external run is completed
Asuming you are using windows. You can can just add the [~,~] as output to the system command, this way matlab will wait unti...

fast 2 Jahre vor | 0

Beantwortet
I want to Access value by using its key , the login should to be like if user enter key1 it should match with key1 keyword from excel sheet and give value_1 as output.
Hi, you can compare the strings of the key with the user input, and then use that index to retrieve the value: UserInput = "key...

fast 2 Jahre vor | 0

Beantwortet
Read the column 2 and 11 from 45 csv files in 45 subfolder hence plot them.
Distance(i) = table2array(data(:,2)); Here you are trying to store an entire array into a single placehoder. Unless data(:,2)...

fast 2 Jahre vor | 1

Beantwortet
How to mark the maximum of a surf plot
I'm guessing you switched maxa and maxb. Note that the columns are plotted on the x axis and the rows on the y axis. alpha=50; ...

fast 2 Jahre vor | 0

| akzeptiert

Mehr laden