Answered
Hello. Is it important to arrange the points in order to use the scatteredInterpolant command?
The order of the Points and Values stored in the scatteredInterpolant does not matter. xy = [1 1; 2 4; 3 9; 4 1; 5 5]; z = [2 ...

4 years ago | 0

Answered
Delete rows from a matrix using for loop
No loops are necessary: Matrix = [1 1; 1 2; 0 0; 0 0; 3 1; 0 0] Matrix(all(Matrix == 0,2),:) = []

4 years ago | 2

Answered
Graph not hitting y=0 at the end
max_x=0; max_y=0; % t=0; % ts=0.1; g=9.81; % v=input("Enter V:"); % angle=input("Enter Angle:"); % I can't run input(...

4 years ago | 0

Answered
How can I correct this error?
% creating some random data: nfiles = 496; All_Horas = 1:nfiles; All_PpH = randn(1,nfiles); figure(1) vend = 1:24; for k...

4 years ago | 0

| accepted

Answered
what is the difference between cos(8) and cosd(8)
With the d, the input angle is interpreted as being in degrees. Without the d, it's in radians. Example, these two commands wil...

4 years ago | 0

| accepted

Answered
Callback to edit box to update variable
It's not typically necessary (or a good idea) to have data in a UI mirrored in the base workspace, but here's how you can do it ...

4 years ago | 0

Answered
Exclusion of inappropriate inputs in a function
function [offsets,Nodes,lengths,angles] = grid_syr(x_i,y_i,nex,ney,L1,L2,theta,phi) if ~isnumeric(x_i) || ~isnumeric(y_i) ......

4 years ago | 0

| accepted

Answered
Why are the "For loops" not looping?
I bet it's because of that return statement. When the code encounters a return the function is exited immediately (thus no more ...

4 years ago | 0

| accepted

Answered
What could the possible reason or solution for this error message? Please help. Thanks in advance.
One or more of the variables in that expression is non-scalar, that is, an array with more than one element. It could be Q_TSU, ...

4 years ago | 0

| accepted

Answered
How to save each loop ieration for creating a surf
I'm not sure what functions or variables ecv and size1 are, but maybe the following bit of code can be a useful reference (note ...

4 years ago | 0

Answered
Run multiple exe at same time
Yes, you can use "&" to return control to MATLAB immediately after the exe starts. Then you can immediately run an exe again. Fo...

4 years ago | 1

| accepted

Answered
同じ行を探す
A = [1 2 3; 2 3 1; 3 2 1; 1 3 2; 1 2 3]; B = [1 2 3; 3 2 1]; find(ismember(A,B,'rows'))

4 years ago | 0

| accepted

Answered
How to determine when the values in an array settle to a value within specified margins.
It sounds like you're going for something like this: is_settled = SimData{2} > 0.98 & SimData{2} < 1.02; if is_settled(e...

4 years ago | 1

| accepted

Answered
Error With Output Argument Not Assigned to a Value Function
It's printing a message that says "Error", but it's not throwing an error _per se_. Therefore, execution continues and you get t...

4 years ago | 0

Answered
Delete rows from a matrix using for loop
The MatrixAux in your example doesn't seem to correspond to the process you decribe. Maybe I'm misunderstanding, but it seems li...

4 years ago | 0

| accepted

Answered
rounded time value with intervals
Something like this might work for your purposes: secondsSinceMidnight = 26850.431; minuteInterval = 15; % round *up* to ne...

4 years ago | 1

| accepted

Answered
Combine hundred of mat files into one mat file (same quantity of row and column)
Here's one way: % file_names = sprintfc('bearing1_1_%d.mat',1:123); % use this for files 1-123 file_names = sprintfc('bearing1...

4 years ago | 0

Answered
Return index of cell in a cell array for which contains a desired element
C = {[1,2,4], [3,5], [8,9]}; find(cellfun(@(x)ismember(2,x),C)) find(cellfun(@(x)ismember(8,x),C)) find(cellfun(@(x)ismembe...

4 years ago | 0

| accepted

Answered
symmetrical character array with only letters
Use isstrprop(): a = 'abba'; isItSym = isequal(a(:),flip(a(:))) && all(isstrprop(a(:),'alpha')) a = 'p##p'; isItSym = isequa...

4 years ago | 1

| accepted

Answered
Removing large parts of an array
If it is a row or column vector: x = randn(1,8000); size(x) last_n_to_remove = 7000; x(end-last_n_to_remove+1:end) = []; ...

4 years ago | 0

| accepted

Answered
How can i create a column vector that sotres PERMNO for all that had positive ret and name this column vector as sample?
% reproducing your table: data = num2cell([ ... 10026 20201231 155.37 0.072598 155.37 155.48...

4 years ago | 0

Answered
matrix calculation have wrong answer
I think the difference you see between the case when you run m_k_ranhTQ_1() with matrix X,Y vs the case when you run it with sca...

4 years ago | 0

| accepted

Answered
surf function give wrong graph
Try this instead: load('m_k.mat'); load('y_test.mat'); load('z_test.mat'); % surf(y_test,z_test,m_k); surf(y_test,z_test,...

4 years ago | 0

| accepted

Answered
Use logical indexing to create a new structure containing specific data from an excel file
file1 = readtable('Random.xlsx') %use readtable function to load caregiver data table = table2struct(file1) dog_data = table(...

4 years ago | 0

| accepted

Answered
Plot from 26 by 20 matrix vs a 2D matrix
If I understand correctly, the column used to get the x-coordinates out of the matrix lnRe_phi, needs to be 1, 2, 3, 4, 5 when i...

4 years ago | 0

| accepted

Answered
3D matrix from 2D matrix multiplied by 1D array
My guess is that Re_Phi and/or Nu_r are matrices before this code is run Re_Phi = magic(4) omega = {1}; Re_Phi {1,1} = (omega...

4 years ago | 0

| accepted

Answered
How to add 'NaN' at the beginning of a table?
Here's one way: t = table(randn(8,1),'VariableNames',{'F0'}) t = [table(NaN,'VariableNames',{'F0'}); t]

4 years ago | 0

| accepted

Answered
Plotting five figures from one 7 x 20 matrix
Something like this? X1 = [0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000]; % pstar = cell2mat(pStar); p...

4 years ago | 0

| accepted

Answered
How to rename files and put them into structure?
If I understand the situation, there is a limit on the number of antennas you can store in pairs in file names like that. I mean...

4 years ago | 0

| accepted

Answered
function for if loop
name(); % call the function defined below, as specified function name() % no input, as specified, and no output % table has ...

4 years ago | 0

| accepted

Load more