A répondu
Finding 4 closest values to a value in an array
use mink [~,idx] = mink(abs(data-find_point),5); data(idx)

plus de 3 ans il y a | 1

| A accepté

A répondu
How to get Y-values from X-values?
if you just want the Y value for the nearest point: [~,idx] = min(abs(X-certainX)); certainY = Y(idx); I don't see quite th...

plus de 3 ans il y a | 0

| A accepté

A répondu
How to increase fontsize of matlab IDE?
there is a workaround here that probably still works: https://www.mathworks.com/matlabcentral/answers/233543-how-to-change-the-...

plus de 3 ans il y a | 0

A répondu
Can you plot polarplots so that theta zero location is at any arbitrary angle or are top left bottom right the only options?
something like this: top_angle = 24; % get current labels tt = thetaticks; % rotate angles so top_angle takes place of 90 t...

plus de 3 ans il y a | 0

A répondu
How to plot many curves on a x-y-x axis system
sounds like plot3 is what you want, though I'll warn you that getting readable figures out is more an art than a science

plus de 3 ans il y a | 0

A répondu
How do I display the first 20 numbers of the Fibonacci sequence?
you need to define the first two numbers manually, then start on the third f(1) = 0; f(2) = 1; for a=3:20 ... Also, it's un...

plus de 3 ans il y a | 0

A répondu
Convert a non uniform cell array of cell arrays to matrix
(see comments on question for details not related to the title question) A1 = cell2mat(runData_struc{1}); A2 = cell2mat(runDat...

plus de 3 ans il y a | 0

| A accepté

A répondu
Preallocating a variable that changes size every for loop iterations.
It's just a code suggestion, you can safely ignore it.

plus de 3 ans il y a | 0

A répondu
Saying Else is invalid syntax
you have two else's for the same if. Select it all and hit CTRL-i to smart indent to see: function [d1,d2,d] = dotangle(u,v) m...

plus de 3 ans il y a | 0

A répondu
Histogram with many data
Use tall arrays: https://www.mathworks.com/help/matlab/import_export/tall-arrays.html

plus de 3 ans il y a | 0

A répondu
Data Cleansing in Tables
test_rejoined = outerjoin(test(:,[1 3 4]),test(:,[2 5]),'LeftKeys','id2','RightKeys','id','MergeKeys',true); separate table int...

plus de 3 ans il y a | 0

| A accepté

A répondu
Fitting and smoothing the noisy curve
check out smoothdata and this guide

plus de 3 ans il y a | 0

| A accepté

A répondu
Row unity in matrix
P_norm = P./sum(P,2);

plus de 3 ans il y a | 0

| A accepté

A répondu
Hi, I am asking the user for input and the input should be either "AA" "Aa" or "aa". How can I validate the input using a while loop? I don't think my code works.Thanks!
You're requiring that it be all valid entries simultaneously parentOneA = input("Enter Parent 1's A Trait: ") % Error checking...

plus de 3 ans il y a | 0

A répondu
Im putting in my equations wrong and i need help
should that be T1? also, replace 25 hardcoding with v0 (and 30 with T1) d1= (v0.*cosd(T2)/g).*((v0.*sind(T2))+sqrt((v0.*sind(T2...

plus de 3 ans il y a | 0

A répondu
sub2ind gives error: Error using sub2ind (line 73) Out of range subscript.
sim_i_r was valid indices (integers greater than zero), but you changed it to invalid ones (zeros, decimals, negatives). Matlab ...

plus de 3 ans il y a | 0

| A accepté

A répondu
Index daily values in TT over many years to determine mean
This will create a table with the average for each day of the year (1-366). 'dayofmonth' might be preferable for just July data ...

plus de 3 ans il y a | 0

| A accepté

A répondu
While starting Matlab icon on desktop, it is throwing error matlab.exe is moved or deleted.
delete the Matlab icon on your desktop type "Matlab" into your Start Menu search The top result should be the Matlab app/progr...

plus de 3 ans il y a | 0

A répondu
Plot bar chart with log scale on y axis with different base
% set whatever base you want (incl. decimals) mybase = 2; % get current limits yl = ylim(); % convert to log-mybase scale y...

plus de 3 ans il y a | 0

A répondu
What frustrates you about MATLAB? #2
Livescript complaints First off, they've come a long way since I tried them on release. But, there are still some issues: Drop...

plus de 3 ans il y a | 1

A répondu
How to store a matrix, A, in variable X, where X is also carrying a counter "i"
Simple way: add a third dimension, "pages": X(:,:,i) = A; But, if you only need the last iteration, it's better to store jus...

plus de 3 ans il y a | 0

A répondu
Permutations of array retaining sub-array groups together
I believe the best way to describe your arrays-with-subgroups is using cell arrays: my_array = {1 [2 3] 4} my_array = {...

plus de 3 ans il y a | 1

A répondu
Does MATLAB have functionality similar to Mathematica's Import function to import html tables?
check out htmlTableToCell on the file exchange, followed by cell2table

plus de 3 ans il y a | 0

| A accepté

A répondu
Random shuffle of image pixels/ Image scrambling
You can use randperm to shuffle the indices randomly, then sort to get the indices for reversing it: % load in an image include...

plus de 3 ans il y a | 0

A répondu
Nested loops and function output into a matrix inconsistency
It seems like your 'w' columns are supposed to correspond to q-r pairs. Currently, this isn't happening, so each q-r pair will f...

plus de 3 ans il y a | 0

| A accepté

A répondu
How to write special characters into an Excel cell?
If you can find the numeric code for the symbols, it should print with that. For example, this prints π | ϕ | μmol/kg T1.Proper...

plus de 3 ans il y a | 0

| A accepté

A répondu
Adding a unit row to a table
% create example table T = array2table(magic(3),"VariableNames",["a";"b";"c"]); % define units T.Properties.VariableUnits = [...

plus de 3 ans il y a | 0

| A accepté

A répondu
Changing empty array for peak width to zero
% preallocate default values pks1 = nan(25,1); loc1 = nan(25,1); width1 = zeros(25,1); prom1 = nan(25,1); for i=1:25 [...

plus de 3 ans il y a | 0

A répondu
How to select matrix column from minimum row value
distance_to_point = [2, 3, 4, 5; 6.8, 2.9, 6.1, 6.7] [~,idx] = min(distance_to_point(2,:)); new_point = distance_to_point(:,id...

plus de 3 ans il y a | 0

| A accepté

A répondu
Aquire random sampling of plot values
Assuming your two datasets share x values and are not absurdly massive, this direct method is probably faster % generate some s...

presque 4 ans il y a | 0

Charger plus