Respondida
How to Plot data groups with different colors?
One way is to plot one line per depth interval, each with a different Color/MarkerFaceColor: % first, I make up some random dat...

alrededor de 4 años hace | 0

| aceptada

Respondida
Selecting rows periodically from csv data file.
You can read the whole thing using, for instance, readtable t = readtable('test.csv'); or readmatrix M = readmatrix('test.csv...

alrededor de 4 años hace | 0

Respondida
fgetl - still a valid function?
Yes, fgetl is still a valid built-in MATLAB function. (Notice, the error message says, "error in fgetl (line 32)", so you know ...

alrededor de 4 años hace | 2

| aceptada

Respondida
How can I write both alphabets and numbers in .mat file on same cell?
If I understand the situtation, you have a mat file with some variables and you want to write those variables' names and values ...

alrededor de 4 años hace | 0

Respondida
Edit field numeric appdesigner
Yes. You can have two uilabels associated with that NumericEditField, one uilabel with Text 'Distance :' to the left of the Nume...

alrededor de 4 años hace | 0

Respondida
Matlab Linux Dual Monitor Issue
Maybe explicitly set the Position of the output figure(s). Check the MonitorPositions that MATLAB is using: get(groot(),'Monit...

alrededor de 4 años hace | 0

Respondida
Index in position 1 is invalid. Array indices must be positive integers or logical values.
t(1) is 0 t=0:0.01:1; t(1) and 0 is not a valid index in MATLAB f_m = [1 2]; f_m(t(1)) It looks more like you're using f_m...

alrededor de 4 años hace | 0

Respondida
Plotting boxplots at specific x axis locations over other data
You can specify the locations of the boxplots in the x direction using the 'Positions' argument: ROSdata = readtable('ROS_data....

alrededor de 4 años hace | 1

| aceptada

Respondida
Index exceeds the number of array elements. Index must not exceed 2.
This error happens because t has only two elements, so there is no element t(3). How to fix it depends on what the code should ...

alrededor de 4 años hace | 1

Respondida
I don't know where my code is wrong
This line: height=2*(ycm+zcm*tan(theta(i)); % 1 2 3 21 is missing a close parenthesis ) somewhere.

alrededor de 4 años hace | 1

Respondida
Hello, Could anyone please help me with this issue. In this code, I want to save the output results after each increment in excel and I am unable to do it. Thanking you .
V is a 3-by-1 column vector in each iteration of the for loop, so one way to save them all is to make V a matrix instead, calcul...

alrededor de 4 años hace | 0

| aceptada

Respondida
How can I generate a Contour Plot from 1 column of Z data?
reshape the column vector to a matrix of the appropriate size, which is 8-by-225 (Ny-by-Nx). That can be done in two ways, and t...

alrededor de 4 años hace | 0

| aceptada

Respondida
For loop for Sine wave function
Yes, you can avoid that warning by pre-allocating sweptsin to the size it needs to be, which is the same size as t: T=5; %size ...

alrededor de 4 años hace | 0

| aceptada

Respondida
Error importing .csv file with import script generated but not with green tick import button
The problem is that the line endings in that file are \r\r\n, i.e., two carriage return characters followed by a line feed chara...

alrededor de 4 años hace | 0

| aceptada

Respondida
Operate on 3d matrix based on 2d logical
You can manipulate B to be the same size as A and then use B as a logical index into A: % a (smaller) random 3D matrix: A = ra...

alrededor de 4 años hace | 0

Respondida
Reading complicated CSV file
Something along these lines might be of use: % get the numbers from the first two lines of the file; % maybe modify this depen...

alrededor de 4 años hace | 2

Respondida
How to create random matrix with specified step in interval [a, b]
a = 5; b = 34; step = 3; offset = 2; n_levels = 1+floor((b-a)/step) % for your reference, showing the min and max % ran...

alrededor de 4 años hace | 0

| aceptada

Respondida
Problem with cycle within a cycle output
You've got to re-initialize h to 1 before each h loop; otherwise you just get h=9 after the first time the h loop completes. As...

alrededor de 4 años hace | 1

Respondida
How to open and read .ffs file matlab?
% (first, make the attached .txt file an .ffs file) copyfile('SpiralAntennaBox_v02_FarField_4p5GHz.txt','SpiralAntennaBox_v02_F...

alrededor de 4 años hace | 0

| aceptada

Respondida
How to sort heatmap columns based on outside data
array = rand(13,28); idx = [13 5 24 23 17 15 3 12 1 25 26 4 18 10 27 14 21 7 20 19 8 28 11 2 6 22 16 9]; h = heatmap(array(:...

alrededor de 4 años hace | 0

| aceptada

Respondida
Cross product of two tables without common key
table1 = table(["A";"B";"C"],'VariableNames',{'Name'}) table2 = table([1;2;3;4],[0;0;0;0],'VariableNames',{'Number','Count'}) ...

alrededor de 4 años hace | 0

| aceptada

Respondida
wavelet denoising of signal
Wavelet Signal Denoiser. Alternatively, something like this may be similar to what you had in mind: C = randn(1,100); metho...

alrededor de 4 años hace | 0

| aceptada

Respondida
Why do I get wrong multiplication result?
teta and phi are row vectors of the same length, so this expression: exp(1i*k*sin(teta).*(m*dx*cos(phi)+n*dy*sin(phi))); is al...

alrededor de 4 años hace | 1

| aceptada

Respondida
help on graph (w/o common matrix plotting built-in functions)
data = randi([0 1],10,30) imshow(1-data)

alrededor de 4 años hace | 0

Respondida
Multiply two cells of an table.
EM_Volllastkurve = table([0;100;200;300],[550;550;550;550],'VariableNames',{'Drehzahl' 'Drehmoment'}) To multiply (row 1, colum...

alrededor de 4 años hace | 1

| aceptada

Respondida
Inaccurate results when writing xls through writetable
From the documentation for writetable: If filename is the name of an existing spreadsheet file, then the writing function write...

alrededor de 4 años hace | 0

| aceptada

Respondida
I want to compare every matrix element to a constant then calculate a new matrix based on every case
Use logical indexing: A = [ 1 2 3 4 5 ]; b = 3; C = zeros(size(A)); C(A < b) = A(A < b)*b; C(A >= b) = A(A >= b)+b; di...

alrededor de 4 años hace | 0

| aceptada

Respondida
How can I export a string to a .txt file?
From the documentation for save: "Use one of the text formats to save MATLAB numeric values to text files. In this case: Each ...

alrededor de 4 años hace | 0

Respondida
Batch processing using for loop
load with no output loads the contents of the mat file into the workspace, overwriting any variables of the same name that were ...

alrededor de 4 años hace | 0

| aceptada

Respondida
how to conver to 3d plot to 2d plot well?
You could make a 2d plot of some kind whose color comes from the data in the 3rd dimension, e.g., a surface or a contour: lat =...

alrededor de 4 años hace | 0

| aceptada

Cargar más