Risposto
Concatenate a column of cells into a single array
cat() is also a possiblity Y = cat( 2, X{:} ); Example >> X = { rand(4,1), rand(4,1), rand(4,1) } X = 1×3 cell array ...

circa 7 anni fa | 0

Risposto
Correct way to specify default property values when constructor uses inputParser.
The default values of properties in the properties block are assigned once when the first object is created . Subsequent objects...

circa 7 anni fa | 1

| accettato

Risposto
Code to run script multiple times
Assumtions: NFRO3Rec is a function that "accepts a vector x and returns a vector F" r is not changed in your code Alternate s...

circa 7 anni fa | 2

Risolto


Project Euler: Problem 8, Find largest product in a large string of numbers
Find the greatest product of five consecutive digits in an n-digit number. 73167176531330624919225119674426574742355349194934...

circa 7 anni fa

Risposto
how to initialize the data from .txt data?
Try >> m1 = dlmread('H:\m\cssm\TESTRATE.txt'); >> m2 = dlmread('H:\m\cssm\DATANAME.txt'); >> whos m* Name Size ...

circa 7 anni fa | 1

Risposto
Reference To Non-Existent Field
I have reproduced the error you see - sort of. Running FruitCalculations_main on R2018b throws an error >> FruitCalculations_m...

circa 7 anni fa | 0

| accettato

Risposto
How do i break a loop at set values to NaN
Try if alpha(i)<(-pi)||alpha(i)>(pi) x(i+1:end)=NaN; alpha(i+1:end)=NaN; break end

circa 7 anni fa | 0

| accettato

Risposto
How can I tell which modules are being used in my program?
Try [flist,plist] = matlab.codetools.requiredFilesAndProducts('your_program_name'); the answer is in plist - hopefully See m...

circa 7 anni fa | 2

| accettato

Risposto
Sorting from highest to lowest for a particular column
Try this %% C1 = nan( size( B(:,1:end-1) ) ); %% for rr = 1 : size(B,1) C1( rr, 2 ) = A( B(rr,2), B(rr,3) ); end C1(:...

circa 7 anni fa | 1

Risposto
Exporting data from for loop into text file
"gives me all the data in a row:" This script produces two columns %% BOLD = reshape( (1:6), [],1 ); x = (1:size(BOLD,1))./1....

circa 7 anni fa | 0

| accettato

Risposto
four dimensions array's expression
>> size(B) ans = 2 3 1 3 the statement B = cat(4,A(:,:,1),A(:,:,2),A(:,:,3)) concatenates three 2D a...

circa 7 anni fa | 0

Risposto
How can I multiply one output of this function with another output from this function?
comment out clear all; run the script rename Tp run the a second time Or convert the script to a function that returns Tp a...

circa 7 anni fa | 1

| accettato

Risposto
startup.m not found in local folder
This works for me. Have you set the "Start in" folder? btw: I don't think it's a good idea to put startup.m in c:\Program Fi...

circa 7 anni fa | 1

Risposto
how to read read a specific rows in .txt and put it in class?
The problem is caused by the first character of line 11. It's char(26) The function readtable() reads the file

circa 7 anni fa | 1

| accettato

Risposto
Assigning values to an array of arbitrary dimensions in MATLAB.
"The problem I have is to be able to this with an arbitrary value of j." I think value2arrayND does that. It takes a cell array...

circa 7 anni fa | 1

| accettato

Risposto
Speeding up the manipulation of large matrices
Your code, "diff(temp,[],2)==0,2)", made me think that temp holds whole numbers. If so, you could convert temp to an appropriate...

circa 7 anni fa | 0

| accettato

Risposto
How can I call the variables of MATLAB workspace from a function?
Do you have a good reason for doing this? Hint: function save_base_workspace() evalin( 'base', 'save( ''save_base_works...

circa 7 anni fa | 3

| accettato

Risposto
Convert an array of numbers into letters using logical indexing
Another approach >> grades = reshape([ 6.29, 5.87, 5.28, 7.38, 7.40, 4.07, 4.23, 7.25, 3.60 ... , 4.37, 4....

circa 7 anni fa | 0

Risposto
How to store Data in a MATLAB® data file as a MATLAB dataset object?
I successfully (R2018b) ran the example of the documentation that you linked to. Did you try it? "MATLAB dataset object" see d...

circa 7 anni fa | 0

Risposto
How to clear the workspace from within a program?
Read Base and Function Workspaces Your program is that a script or a function? Your question makes me believe your program is ...

circa 7 anni fa | 1

Risposto
Windows(CR LF) to Unix (LF)
You have a few options Open the file in Notepad++ and replace CRLF by LF as shown by the screen clip below. Use the solution, ...

circa 7 anni fa | 1

| accettato

Risposto
Efficiently import text file with irregular struture
See Import Block of Numeric Data from Text File and How do I parse this complex text file with textscan? If you need further...

circa 7 anni fa | 0

Risposto
Getting error message, "Subscript indices must either be real positive integers or logicals."
MATLAB has indexing of arrays beginning from 1 instead of 0, thus replace for i =0:1:75 by for i =1:1:76

circa 7 anni fa | 0

| accettato

Risposto
How to store columns of different lengths using cells
I assume that you intend to put successive values of trimtempstoreCol into cells of newData. To do that, replace newData{t...

circa 7 anni fa | 0

| accettato

Risposto
If statement correction help
"I need is to create an array of 1000 random variables from -1 to 0 and 1/2 to 1" Another approach >> X1 = rand(1,1e3)*1.5 - 1...

circa 7 anni fa | 0

Risposto
I'm not sure what im doing wrong on this script...
See TUTORIAL: Why Variables Should Not Be Named Dynamically (eval) Hint: %% C.black = 0; C.brown = 1; C.red = 2; C.orange...

circa 7 anni fa | 0

Risposto
string to text file
This creates a textfile, which notepadd++ opens. v1=str(:,1); v2=str(:,2); v3=str(:,3); T = table( v1,v2,v3 ); writetable(...

circa 7 anni fa | 0

| accettato

Risposto
Merge same field of 36 structures
Try this %% numfiles = length(filenames); results = cell(numfiles, 1); for K = 1 : numfiles datastruct = load( filename...

oltre 7 anni fa | 0

Risposto
access data in table using for loop
Try something like this %% idx = {'OMFGA','MBNC'}; OMFGA = cell( 1, numel(idx) ); for ii=1:numel(idx) B = strcmp(compTi...

oltre 7 anni fa | 0

Risposto
How to extract values to create a table on excel?
Try >> [x,y,T] = steadyheat_jacob() where function [x,y,T] = steadyheat_jacob() %----------------------------------...

oltre 7 anni fa | 0

Carica altro