Respondida
Function handle in structure field generating data from other fields
With a structure, it's not possible to do what you want. With a class, yes, using dependent properties. classdef DemoClass ...

alrededor de 7 años hace | 0

| aceptada

Respondida
Problem with piece-wise function with logical indexing.
But I don't understand WHY matlab is evaluating this bit of the fuction when it's outside the specified range (t>=1200). That e...

alrededor de 7 años hace | 1

| aceptada

Respondida
How to recognize if there is in a character a point '.'?
Edit: I misunderstood the question. It's even simpler than what I initially wrote. Simply: xx == '.' If you want to check mul...

alrededor de 7 años hace | 1

Respondida
Swap group of elements in a matrix with specific conditions
Indeed use, findgroup and splitapply: group = findgroups(a(:, 1), a(:, 2)); groupswap = splitapply(@(c3, c4) max(c4)>max(c3), ...

alrededor de 7 años hace | 0

| aceptada

Respondida
How do I get specific data using inpolygon in Matlab?
I don't have the mapping toolbox and knows nothing about it, so possibly the problem is with your coordinate transformation code...

alrededor de 7 años hace | 1

| aceptada

Respondida
i am trying to find the euclidean distance of 2 vector with different sizes
I'm also not clear on what you're asking. If you want to find the euclidean distance between each row of T and each row of X, th...

alrededor de 7 años hace | 0

| aceptada

Respondida
why I get unintelligible text
what wrong in my code You're using fscanf to read both numbers and text. it doesn't work very well for that. In particular, the...

alrededor de 7 años hace | 0

| aceptada

Respondida
How can I generate C++ class from a class implemented in Matlab?
The only way is by writing the C++ code yourself. There's enough difference between matlab classes and C++ classes that it may n...

alrededor de 7 años hace | 0

Respondida
How to write repeating string with variables in for loop
Well, if you really want uncluttered: line = cell(7, 75); line([1 3 5 6 7], :) = repmat({' new ScreenItem(ScreenVideoComp...

alrededor de 7 años hace | 1

Respondida
Extracting edited tables from cell array and saving them back to original variables
Note if logicalvalue == 1 is the same as asking if true is true. It's a bit redundant. In addition in matlab it involves conv...

alrededor de 7 años hace | 0

| aceptada

Respondida
Select rows in a table given two conditions
I'm not conviced that your TAB1 is actually a table. If it is: TAB1.Value(strcmp(TAB1.Description, 'CO2') & TAB1.Year == 2020)...

alrededor de 7 años hace | 0

| aceptada

Respondida
How to search for channel name and numerical data in resulting struct after importing multiple data files?
Considering that one of the variable is time, you may be better off storing your data in a timetable rather than a structure Th...

alrededor de 7 años hace | 0

Respondida
besoin d'ajouter figure/Image pour la génération d'un rapport
Je n'ai pas la toolbox, mais si j'ai bien compris la documentation: append(D, Figure('fleche maximale.fig')); translation: I d...

alrededor de 7 años hace | 1

Respondida
Reading text file using fprintf and textscan
You could continue to use textscan, you don't specify line endings and separators in the format string: fid = fopen('test.txt')...

alrededor de 7 años hace | 0

| aceptada

Respondida
Select elements from only three consecutive columns.
startcolumn = randi(size(yourmatrix, 2) - 2); %select 1st of 3 consecutive column at random candidateelements = yourmatrix(:, ...

alrededor de 7 años hace | 0

| aceptada

Respondida
how to export data into text file
Assuming that your Values_S_Cx vectors were column vectors so that Single is a numel(Total) x Ncolumns matrix, then: writetable...

alrededor de 7 años hace | 1

| aceptada

Respondida
Delete Columns from a table where the 1st element in the column is a negative number?
Your screenshot does not appear to be that of a matlab table. It looks like you have a matrix, so: yourmatrix(:, yourmatrix(1, ...

alrededor de 7 años hace | 0

| aceptada

Respondida
Does using cells cause dramatically slow down the code?
A cell array of scalar numbers will always be slower to process that a matrix with the same scalar numbers, yes. There's also no...

alrededor de 7 años hace | 1

| aceptada

Respondida
Adding a frame of zeros to a matrix
Not sure which corner you want to pad with zeros. I'm assuming bottom right: newmatrix = [yourmatrix, zeros(size(yourmatrix, 1)...

alrededor de 7 años hace | 1

| aceptada

Respondida
How to compare two matrices in different sizes/dimensions ?
C = intersect(A, B, 'rows') %possibly with the 'stable' option if ordering matters.

alrededor de 7 años hace | 0

| aceptada

Respondida
Text file parse and reformat and storage
Your file is an xml file, so it should be parsed with an xml parser. Parsing it as text or html will always be fragile. Thankful...

alrededor de 7 años hace | 1

Respondida
Apply the same function into several columns
Use a loop: B = zeros(1, size(A, 2)); for column = 1 : size(A, 2) B(column) = yourfunction(A(:, column)); end Or you ca...

alrededor de 7 años hace | 0

| aceptada

Respondida
if-loop: Devide a table and save the parts in cell array
Note that you are not using what matlab calls a table. You may actually be better off using tables or even better timetables. A...

alrededor de 7 años hace | 0

Respondida
problem displaying data on spreadsheet
When you create a table, if you want the elements of the inputs to become rows of the table, then you need these inputs to be co...

alrededor de 7 años hace | 0

| aceptada

Respondida
How to colour columns of a matrix
The first problem with your code is that you're assuming c is integer when it will most likely not be. In any case, the whole l...

alrededor de 7 años hace | 1

| aceptada

Respondida
How to Create Multidimensional table in for loop
You could store your 15 tables into a cell array, Trajectory = 1:15; TrajDetail = cell(size(Trajectory)); for i = 1:numel(Tra...

alrededor de 7 años hace | 0

Respondida
How to do wait calllib to give answer or catch exception?
No, you can't do something like that in matlab and even in languages were you have access to the OS API it wouldn't be trivial t...

alrededor de 7 años hace | 0

| aceptada

Respondida
Why am I getting 'ans=45' in this code?
If a function normally return an output but you don't assign this output to a variable, matlab automatically create a variable c...

alrededor de 7 años hace | 1

Respondida
matlab cell array indexing
I'm assuming your C1 and C2 are not actual numbered variables but elements of a cell array, in which case: newC = cellfun(@(c) ...

alrededor de 7 años hace | 0

| aceptada

Respondida
Script that Accurately counts lines in a text file
linecount = sum(fileread(somefile) == 10) + 1; See Walter's comment. This will count the emptiness between the newline and end ...

alrededor de 7 años hace | 0

Cargar más