Réponse apportée
write an array of 8 bit binary to text file?
You don't need fopen, fprintf, or fclose. A simple script like this will do the trick: binX = ['00101111'; '00101111'; '0111001...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
How do I get each array produced by a for loop iteration to be added as a different column in matrix?
This should work: k = 1; for olYears = 2000:2020 p = find(olYr == olYears); p1 = olTemps(p) %this produces an array ...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
How to subtract previous array element from the current one ?
If you want to subtract previous Easting value from the current one see below. The value you want is EastingDiff. Easti...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
How to take average for each bin and then plot it?
Here's what I put together. Looks like most of the 19124 data points have NaN for either temperature or data. There are 6901 p...

presque 5 ans il y a | 0

Réponse apportée
How can I stop my program if the user enters 0 for all variables?
There are a few ways to set this up. Here's one... while true clc; a = input("a = "); b = input("b = "); ...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Tabluate data using common terms in varaible names
If I understand your question correctly, you want to extract the row and column names from the variable names. If so... ab_MLD...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Could anyone help me how to extract different specific number of rows in a matrix.
B = A(sort([1:5:100 2:5:100]))

presque 5 ans il y a | 0

Réponse apportée
Regression Model Graph(plot), Deflection Problem(sharp point or cusp)
You are getting the sharp bend because you are calculating YFIT using the x sample points (which are sparce at the inflexion poi...

presque 5 ans il y a | 0

Réponse apportée
The code does not see else condition
You've got an error in how you setup the if-expressions. For example, you need to change the first if-expression from 320 < wa...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
How can I Draw a Line on a 3D plot?
Here's an example using line. I used your code, but re-assigned ax.UIAxes2, Bat, and value so the code would execute on my mach...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Excel Variables and Data Analysis
I'm attaching some fake data I put together that match the description of your data. Given this, here's some code to answer you...

presque 5 ans il y a | 0

Réponse apportée
Find the index of specific values in my matrix
No need for loops. Just use the ind2sub function: A = [0 0 1 0 1 0 1 0 1 0 0 1 1 0 1 0 1 0] [x, y] = ind2sub(...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
remove empty rows of a cell
reshape(K(~cellfun('isempty',K)), [], size(K,2))

presque 5 ans il y a | 0

| A accepté

Réponse apportée
How to add text on the figure without unknown x and y coordinates ?
To print 'hello' in the center of the figure... (adjust accordingly) ax = gca; x = ax.XLim(1) + (ax.XLim(2) - ax.XLim(1)) / 2;...

presque 5 ans il y a | 0

Réponse apportée
What is the problem in my for loops?
You don't need nested loops: m = 12; n = 2; p = 100; fprintf('\nColumn 1\t\tColumn 2\n'); for i = 0:n:m a = 2....

presque 5 ans il y a | 0

Réponse apportée
How to make graphic get the same color as the colorbar?
I think this achieves what you are after. Use mesh, instead of plot3, and the mesh colors will be linked to the colorbar: % yo...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
Measuring distance in 2D plot
Just adding this to the end of your code achieves what you are after (I think). The x-length of the line easy enough to calcula...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Variables in matrix not updating from for loop
I think this is what you are looking for. It updates k in the z matrix in each iteration of the loop. The max values accumulat...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
How to choose the middle of a random cell in a 2D grid
This solution is simpler. It creates the grid using lines instead of a mesh. % x axis smin = 0; L = 4; ns = 25; s = lin...

presque 5 ans il y a | 0

Réponse apportée
Read elements on one side of matrix diagonal into a 1D array
There might be a tighter solution, but I think this achieves what you are after: a = magic(4) b = a'; c = logical(triu(ones(4...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
How do you write a nested if statement that checks if the user has entered certain numbers?
This is an example of input validation. Here's one method that achieves what you are after. The prompt is repeated until the u...

presque 5 ans il y a | 1

| A accepté

Réponse apportée
Creating index and replacing values
Below is a loop solution. There might be a way to vectorize this -- not sure. A = [0 0 1 0 1 0 0]; B = [ "030121", "030221", ...

presque 5 ans il y a | 0

Réponse apportée
How to find multiple table column numbers by column names?
col_ind_rmt = find(string(G_Value.Properties.VariableNames) == "rk_mill_tonnage" | ... string(G_Value.Properties.VariableNa...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
How to choose the middle of a random cell in a 2D grid
OK, thanks for the clarification. I think this achieves what you are after. The added code randomly chooses vertices (points) ...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Customed distance function Haversine
You need to re-work your haversine function, as per the requirements for distance functions used with pdist2. A custom distance...

presque 5 ans il y a | 0

| A accepté

Réponse apportée
Verifying an Vector composition
There is probably an easier approach, but I think this works. The result of this expression is 1 if a1<a2<a3<a4<a5, or 0 otherw...

presque 5 ans il y a | 1

Réponse apportée
how can I sweep a triangle area using two loops
No need for loops. The tests are built in to the inpolygon function when you provide matrices as input. Assuming you want to f...

presque 5 ans il y a | 0

Réponse apportée
HOW TO FILTER AN HOUR DATA FROM ARRAY OF DAILY,MONTHLY AND YEAR DATA
T = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/658625/SAMPLE%20DATA.xlsx'); % combine DATE and...

presque 5 ans il y a | 0

Réponse apportée
How to duplicate cell array by rows?
n = handles.times; % your integer value newSequence = repmat(sequence, 1, n);

presque 5 ans il y a | 0

| A accepté

Réponse apportée
integral of a matrix
You note: I want to take the integral of an exponetial of a matrix But, exp(-M.*t)*Dmat; is a vector, not a matrix. Tr...

presque 5 ans il y a | 0

Charger plus