Risposto
How to write function for two variables
I'd approach writing the functional something more like-- function y=Y(C,x1,x2) % Magic function Y=fn(C, x1, x2) from unknow...

oltre 3 anni fa | 0

| accettato

Risposto
Combine text files with continues time stamp
Can you clean up the malformatted file format first? It uses "," for both the field delimiter as well as the decimal place indi...

oltre 3 anni fa | 0

Risposto
Can I run all cases of switch ? if not, is there another way ?
That's just putting the switch block inside another loop... ... M=5; % outer loop counter N=3; ...

oltre 3 anni fa | 1

| accettato

Risposto
use two indexes at the same time in a for loop
for i = 4:5 for j = 1:2 M(i,j) = 0; end end If it weren't a contstant on the RHS and the array was only the...

oltre 3 anni fa | 0

| accettato

Risposto
Error with the matlab curve fitter app
The CurveFitter App is simply not designed to be used in this manner. To do this, you would create a fit object directly with t...

oltre 3 anni fa | 0

Risposto
How to cut out part of x axis in scatter plot ?
Unfortunately, MATLAB doesn't have the facility to create either split axes to show such a gap or to condense a section of an ax...

oltre 3 anni fa | 0

| accettato

Risposto
Extracting rows form a matrix with indices.
M=[[1:24].' randi(100,24,5)]; % a sample array b=[1,4,7,8,10,12]; % the indexing vector N=M(b,:) ...

oltre 3 anni fa | 0

| accettato

Risposto
how can i define legend for bar3
Z=randi(6000,4,5); X=["EVA"+[1:4].'; "DNO"]; Y=[125:-25:50]; hB3=bar3(Z); hAx=gca; hAx.XAxis.TickLabels=X; hAx.YAxis.TickL...

oltre 3 anni fa | 0

Risposto
two x-axis plot
Without all the niceties, but to illustrate putting the three points on two axes and set ticks such that grid lines will match u...

oltre 3 anni fa | 0

Risposto
Save matrix from "writematrix" to clipboard
You've got to create the entire text as a string or char() variable. It would be more efficient to avoid the intermediary disk ...

oltre 3 anni fa | 0

| accettato

Risposto
How can I put an array containg multiple numbers into a matlab table?
Just use <table> directly to insert variables to a table... files={'filename01.ext';'filename02.ext'}; coords=[randi(1000,1,4)...

oltre 3 anni fa | 0

Risposto
How do you remove the exponent from all y-axes on a stackploted figure?
Actually, the above isn't true; it turns out you CAN get to the underlying axes objects and they are still "plain, ordinary axes...

oltre 3 anni fa | 0

Risposto
How do you remove the exponent from all y-axes on a stackploted figure?
Some things aren't possible; that's one....see the discussion about what a stackedplot object is in the doc -- s=StackedLineCha...

oltre 3 anni fa | 2

| accettato

Risposto
Find common 4-letter substrings in a list of strings
May be something more clever, but the "deadahead" way for the one string looks something like -- tAMP=readtable('AMPdb_short.cs...

oltre 3 anni fa | 0

| accettato

Risposto
How can I extract a specific time for a "datetime" table?
Convert to datetime and use <isbetween> result.HourSeries=duration(result.HourSeries,'InputFormat','hh:mm'); ix=isbetween(resu...

oltre 3 anni fa | 1

Risposto
How to extract eye tracking data by trial ID
Easiest would be to read the file line-by-line, looking for the magic value and then save data until the next, adding the trial ...

oltre 3 anni fa | 0

| accettato

Risposto
Replace Nan with empty cell in table
No can do unless convert the table variables to cell arrays; a double array cannot have anything other than numeric values. A M...

oltre 3 anni fa | 0

| accettato

Risposto
Arguments accept char, string or "cellstr" (cell array of char or string)
You write a custom validation function that your code in the arguments block calls for special cases if you're using the supplie...

oltre 3 anni fa | 1

Risposto
What is missing from MATLAB #2 - the next decade edition
I wish clearvars had an optional "do-nothing" flag a la the /L switch in CMD XCOPY to display the variable that would be cleared...

oltre 3 anni fa | 1

Risposto
How to extract the time differences between two events into a table?
" is attached through google drive because of the file size" It would have only taken a 100 lines or less to have sufficient to...

oltre 3 anni fa | 0

| accettato

Risposto
signal processing of vibration signal
Have gone through this innumerable times -- and the fft doc gives an example of normalizing the one-sided PSD to match the time ...

oltre 3 anni fa | 0

Risposto
How to quickly view the variables in the mat file? My computer is poor, so it is slow to open matlab😭
Just leave a MATLAB session open, don't close it if you have such use/need frequently. Or, if the content of these .mat files i...

oltre 3 anni fa | 0

Risposto
Convert cell char array With Column in Table form MATLAB
This is pretty simple with the newer string facilities -- as an example, for the first variable, use something like animal=extr...

oltre 3 anni fa | 0

Risposto
Time and Space Efficiency Problem in Multi-Format .csv file Splicing and Saving
Per usual when things are not totally plain vanilla in some fashion, you need to make use of the extended features supplied in M...

oltre 3 anni fa | 2

Risposto
importdata produces strange output when reading a textfile with blank cells and text
>> opt=detectImportOptions('command_window.txt','ExpectedNumVariables',6,'NumHeaderLines',2,"ReadVariableNames",1,'VariableNamin...

oltre 3 anni fa | 0

Risposto
How to solve a system of coupled first order differential equations using ode45?
... dydt(1)=((-(sqrt(A/y(1)))^-1)*(y(3)+I_iP-(C*exp((-e*y(1))/T_e)))); dydt(2)=((-(sqrt(B/y(2)))^-1)*(-y(3)+I_iG-(D*exp((-e*y(...

oltre 3 anni fa | 0

| accettato

Risposto
cell2table: Preserve cell type when column contains numbers and strings
The problem outlined in the Q? is owing to that you introduced strings into the cell array -- use x={ 0 'Infinity' ...

oltre 3 anni fa | 1

Risposto
How to break data in to groups using while loop?
Answer the Q? actually asked -- I'll post this as a separate answer for convenience but not remove the first. OK, as @Stephen23...

oltre 3 anni fa | 0

| accettato

Risposto
How to break data in to groups using while loop?
No explicit looping construct needed; let MATLAB do it for you...I shortened your variable name to M... M= [1 50 60 70 50 40 ...

oltre 3 anni fa | 2

Risposto
How do I use a loop to go through a large dataset and put each column into a array?
You don't need (and shouldn't even think about creating) another array from the table; just use the data as they are in the tabl...

oltre 3 anni fa | 1

| accettato

Carica altro