Beantwortet
iam trying to solve a system of differential equations of car model using ode45 but I am always get an error
You are using multiple variables inside (almost all of the) local functions but you have not defined them nor have you passed th...

mehr als 2 Jahre vor | 1

Beantwortet
How to find local maxima in a plot
@Imanol Fernandez de arroyabe Zabala, findpeaks is a part of the Signal Processing Toolbox. You need to have the toolbox downl...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How can can this code be made more efficient?
Instead of dynamically naming variables, use a for loop. %Constants g = 9.81; v = 85; %Arrays of values to be used vec = ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
am trying to cluster my data but matlabs keeps on indicating that Unrecognized table variable name 'sub_metering_1'.
Variable names in MATLAB, independently or of a data type, are case sensitive. You need to use the variable name with the proper...

mehr als 2 Jahre vor | 0

Beantwortet
Error while running matlab
"Error while running matlab" That's not MATLAB. But, you are missing "end" to close the if-else condition block.

mehr als 2 Jahre vor | 0

Beantwortet
How to avoid unnecessary legends in the graph?
Turn the auto-update feature off. The names data1 to data5 correspond to the xlines you have drawn (as can be observed from th...

mehr als 2 Jahre vor | 0

Beantwortet
Automatic substitution of a symbolic variable with a numerical value
When you define expressions/variables using str2sym, it does not create the variables defined in the input. Also, it's not a go...

mehr als 2 Jahre vor | 0

Beantwortet
A function handle constructed by a symbolic function and another function handle
You can do this without symbolic variables. The definition is correct, just call the function with appropriate inputs - sigma...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
find variables in a matrix with multiple conditions
I have written a function to check for the criteria you have mentioned. You can also check out this FEX submission for the same...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Adding a Column to a Table
The variable name/title should be used after using the dot notation inside parenthesis and the data to append should be on the r...

mehr als 2 Jahre vor | 3

| akzeptiert

Beantwortet
Find maximum difference between two arrays
Because the code compares a single element i.e. (1,101), not the whole vectors. Use this - m = max(abs(A-B.'),[],'all');

mehr als 2 Jahre vor | 0

Beantwortet
surfc is not working
You need to use X and Z instead of x and z for defining y1 and y2. And you can define y2 = -y1. L=4;B=0.5;D=0.5;x=-2:0.02:2;z=...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
order the rows of the 3 matrices starting from the third coordinate of the point P
Use sort A = [28.0445 -17.2717 83.972 1 2 3 27.8199 -16.986 83.3748 4 5 6 27.2756 -16.339 81.871 7 8 9 25.3805 -14.0329 67.0...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Color Scale for looping script
There is no need of the 2nd for loop, remove it. I have taken random data for example to show a working code below. Secondly, u...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
複数列を決まった列数毎に行列結合
%Total number of files num=200; %Files in each group len=10; %Loop through each group for k=1:num/len %Preallocate a...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
Mean of values in acolumn depending on VARYING values of another column
in =readmatrix('Book2.xlsx'); disp(in) out = accumarray(in(:,2),in(:,1),[],@mean)

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
plotting 2 y-axis in one graph
The ylabel() call for the left y-axis should be done before changing the y-axis to right. Refer to this example - https://in.ma...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Shuffle order of cell array without repeating rows
A brute force approach tailored to the example you have posted - A = {"string1"; "string2"; "string3"; "string1"; "string2"; "...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
LaTeX text in legend command
s=tf('s'); G=725/((s+1)*(s+2.5)*(s+25)); Go=G/(s+1); DeltaG=-s/(s+1); IDG=1/DeltaG; F=1; T1=feedback(F*G,1); figure h...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to get x-values in bar?
Change the x values to categorical data type - x=[1:3,8]; y=[500 500 500 500 69 535 1354 42 97 498 1357 48 73 ...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
How to compress data into numerical intervals
Here's an approach - %Load the data load('CTD.mat'); arr = CTD.Depth; n = numel(arr); %Pre-allocate the variable in wh...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Plots are generated as a screenshot of whole screen using Publish Tool?
Use the robust exportgraphics function.

mehr als 2 Jahre vor | 0

Beantwortet
How to vectorize function on vectors stored in 3D tensor
Try this - function sumeol = sum_over_line(tau, L, zstruct, rstruct, P) before = zeros(P.Ntimes_An, rstruct.rlength); i=1:P....

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
replace characters (like 'n/a') with 0 inside a .txt text file
To read the data from a file, use readmatrix (or readtable) instead of load. The 'n/a' characters will be read as NaN. Then re...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to perform the following data splitting?
%Random data t = 5.2:0.002:5.3; x = 1:numel(t); %Define bins to group data into cats = min(t):0.02:max(t); %Group the ...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Generating random decimals with a range
%Change the display format format longg %Generate random number between [min max]*10^(num_of_demicals) %and divide the outp...

mehr als 2 Jahre vor | 3

| akzeptiert

Beantwortet
How to get a specific shape of a contour plot in MATLAB
One simple way to obtain that is to fill the upper half with white color - x = linspace(0,1,11); y = linspace(0,1,11); Z = [...

mehr als 2 Jahre vor | 3

Beantwortet
not correct output when using fprintf with multiple lines
Arrange the values to make a 2xn vector. fprintf('class %d: number of students %d\n',[1:5; 15 17 12 18 15]) The values are use...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
How to add map to an output
When using heatmap, colormap has to be specified in the call. See below - % Load your data data = readmatrix('subtowersutm.xl...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
Index exceeds the number of array elements (10)
I guess you are trying to do this - var = cell(CC.NumObjects,1); for j = 1:n var{j,1} = double(image(CC.PixelIdxList{1,j})))...

mehr als 2 Jahre vor | 0

Mehr laden