Respondida
How can I access results from loop, that are stored in structs within a cell?
first_obs = 100; last_obs = 110; Nobs=last_obs-first_obs+1; % number rows to compute coeff_i=zeros(Nobs,3); % preallo...

alrededor de 7 años hace | 0

| aceptada

Respondida
Write cell array defined by a variable to a excel file
"a cell array that I get after processing data which needs to be written to a excel file. For some reason, fprintf is not workin...

alrededor de 7 años hace | 0

Respondida
How to vectorize this for maximum efficiency?
>> histc(label_lin,unique(label_lin)) ans = 2 1 1 1 3 >>

alrededor de 7 años hace | 0

Respondida
Can not terminate execution with if/for loop
What's the point of needing to type anything else after the loop has completed its three iterations? At that point you've alrea...

alrededor de 7 años hace | 0

Respondida
(mapping toolbox) Map axes xdata, ydata and zdata meaning?
The map is still an axes underneath the hood so the internal property names are the same. But, the property name is just a name...

alrededor de 7 años hace | 0

Respondida
Can not terminate execution with if/for loop
Your break statement is in a nested for loop that is inside the while construct. break only exits the loop construct in which i...

alrededor de 7 años hace | 0

Respondida
Read multiple .mat files in the file path in sequence
for i=1:10 filename = sprintf('D:\matlab\0_cm(%d).mat',i); % build specific file name myVars = {'Scanning'}; S = load...

alrededor de 7 años hace | 0

Respondida
Extracting certain lines from a text file containing both characters and numbers
Presuming records (including blank lines) are as above, fid=fopen('HB.txt'); data=cell2mat(textscan(fid,'%f%f','headerlines',...

alrededor de 7 años hace | 0

Respondida
How do I split a sing column .txt file by line?
Again, I'd suggest there's no need to actually create multiple text files to do this...several options exist in MATLAB; the simp...

más de 7 años hace | 0

| aceptada

Respondida
How to make heatmap y-axis based on column names, not column values
data = [0 280 1170 0; 62 0 0 0]; VariableNames = {'colA', 'colB', 'colC', 'colD'}; rowid= {'rowA', 'rowB'}; hHM=heatmap(rowid...

más de 7 años hace | 0

| aceptada

Respondida
how to avoid scientific notation when dealing with large integers?
Well, in base MATLAB you can't have more than >> intmax('uint64') ans = uint64 18446744073709551615 >> which is only...

más de 7 años hace | 1

Respondida
Problem in plotting the string variable
Nobody seems to have stumbled onto the easy answer as of yet...leaving the variable as a string when it is clearly a categorical...

más de 7 años hace | 0

Respondida
Getting values from a for loop when specific condition met
break is like drawing the "Go To Jail" card in Monopoly--you "go directly to jail, do not pass GO, do not collect $200". Here w...

más de 7 años hace | 0

| aceptada

Respondida
Controlled Random Generator based off of two columns
function x=trafficX(RP,LO) % returns random count of X within upper limit RP but evenly divisible factor with lower limit LO %...

más de 7 años hace | 0

| aceptada

Respondida
How to sort a matrix's columns by using indexes
See doc sortrows Not clear which array it is you wish sorted but mayhaps can accomplish directly -- altho the auxiliary array ...

más de 7 años hace | 0

Respondida
how to save all iteration output to plot graph later ?
In bending(i) = depl(1,:); you don't have but one index dimension on LHS in which you're trying to store a vector... Before the...

más de 7 años hace | 0

Respondida
Switching an array of Vectors from Cartesian to Spherical Coordinates
The documentation syntax is pretty clear-- "[azimuth,elevation,r] = cart2sph(x,y,z) transforms corresponding elements of the Ca...

más de 7 años hace | 0

Respondida
Question on Plotting from Cell Array
Dereference the cell array with the curlies "{}" for i=1:size(CA,2) scatter3(CA{i}(:,1),CA{i}(:,2),CA{i}(:,3)) if i==1,h...

más de 7 años hace | 0

Respondida
Plot polyfit R-squared
Because >> fittedXA(1),fittedXA(end) ans = 10 ans = 20 >> and that's what you plotted as the abscissa for some re...

más de 7 años hace | 0

| aceptada

Respondida
Sorting Table Data by Groups of Rows
If the number of missing values is always 9, then extract the time column to a vector and t=datatable(:,1); % retrieve th...

más de 7 años hace | 0

Respondida
matlab table from for loops
A table may not be the best for this purpose but iiuc what you're asking for would be something like Nrows=100; Num_of_Banks=r...

más de 7 años hace | 1

| aceptada

Respondida
Problem with plotting dates
Use readtable and maybe detectImportOptions first. Then, plot is datetime-aware, so you just call plot with the two variables.....

más de 7 años hace | 0

Respondida
Geoscatter point size in km
I don't have the mapping TB so can't experiment, but looks like <geobubble> would be better suited to the purpose as it does hav...

más de 7 años hace | 0

Respondida
Can I pass complex numbers from C++ to Matlab using feval or similar?
See mxCreateNumericMatrix for C interface. It can create a complex array. I suppose there's also a C++ version but "I know nut...

más de 7 años hace | 0

| aceptada

Respondida
Loop for mutliple (but variable) number of plots on multiple pages
Figure out how many figures you need a priori... nplots = 13; pperfigure=12; nfigures=ceil(nplots/pperfigure); nUp=pperfigur...

más de 7 años hace | 0

| aceptada

Respondida
Finding the sum of every nth row ( n is not fixed)
You'll have to introduce a day variable...by locating the positions where the hour returns to 0 if is always a 0-hour reading o...

más de 7 años hace | 0

| aceptada

Respondida
I have multiple equations that depend on a specific value and would like matlab to ask the user which equation to use and what the specific value is and then print that value but it's giving me trouble.
Do something more like: materials={'BK7','Fused Silica','Soda Lime','Borofloat','Air','NOA61'}; [material,ok] = listdlg('Promp...

más de 7 años hace | 0

Respondida
How to neatly alternate between two different statements at different intervals
counter=0; Limit=10; for i=1:100 counter=counter+1; if counter<=Limit disp('A') else disp('B') counter...

más de 7 años hace | 0

| aceptada

Respondida
Help parsing predictably messy data
function getdata=a1(fname) % read file sections, return as cell array of sections for subsequent use fid=fopen(fname,'r'); ...

más de 7 años hace | 0

| aceptada

Respondida
Finding first rightmost non-zero column of a matrix?
Same solution as the other except search from the other end... find(any(A),1,'last') I think Azzi's solution there doesn't fin...

más de 7 años hace | 0

| aceptada

Cargar más